K2: reproduce KT-61691

This commit is contained in:
Mikhail Glukhikh
2023-09-08 14:22:14 +02:00
committed by Space Team
parent aacfc31c90
commit 91aa679214
7 changed files with 74 additions and 0 deletions
@@ -1506,6 +1506,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt");
}
@Test
@TestMetadata("AnnotatedCatchValueParameter.kt")
public void testAnnotatedCatchValueParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt");
}
@Test
@TestMetadata("AnnotatedConstructor.kt")
public void testAnnotatedConstructor() throws Exception {
@@ -1506,6 +1506,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt");
}
@Test
@TestMetadata("AnnotatedCatchValueParameter.kt")
public void testAnnotatedCatchValueParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt");
}
@Test
@TestMetadata("AnnotatedConstructor.kt")
public void testAnnotatedConstructor() throws Exception {
@@ -1506,6 +1506,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt");
}
@Test
@TestMetadata("AnnotatedCatchValueParameter.kt")
public void testAnnotatedCatchValueParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt");
}
@Test
@TestMetadata("AnnotatedConstructor.kt")
public void testAnnotatedConstructor() throws Exception {
@@ -1506,6 +1506,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt");
}
@Test
@TestMetadata("AnnotatedCatchValueParameter.kt")
public void testAnnotatedCatchValueParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt");
}
@Test
@TestMetadata("AnnotatedConstructor.kt")
public void testAnnotatedConstructor() throws Exception {
@@ -0,0 +1,22 @@
// WITH_STDLIB
// ISSUE: KT-61691
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class FixCatchValueParameter
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.LOCAL_VARIABLE)
annotation class FixCatchLocalVariable
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS)
annotation class FixCatchClass
fun main() {
try {
} catch (@FixCatchLocalVariable <!WRONG_ANNOTATION_TARGET!>@FixCatchValueParameter<!> <!WRONG_ANNOTATION_TARGET!>@FixCatchClass<!> e: Throwable) {
}
}
@@ -0,0 +1,22 @@
// WITH_STDLIB
// ISSUE: KT-61691
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.VALUE_PARAMETER)
annotation class FixCatchValueParameter
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.LOCAL_VARIABLE)
annotation class FixCatchLocalVariable
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS)
annotation class FixCatchClass
fun main() {
try {
} catch (@FixCatchLocalVariable @FixCatchValueParameter @FixCatchClass e: Throwable) {
}
}
@@ -1506,6 +1506,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedBlock.kt");
}
@Test
@TestMetadata("AnnotatedCatchValueParameter.kt")
public void testAnnotatedCatchValueParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/annotations/AnnotatedCatchValueParameter.kt");
}
@Test
@TestMetadata("AnnotatedConstructor.kt")
public void testAnnotatedConstructor() throws Exception {