diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerFirTestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerFirTestdataTestGenerated.java index 5245c90359c..5d296f04e48 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerFirTestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerFirTestdataTestGenerated.java @@ -674,6 +674,22 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt"); } + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/annotations") + @TestDataPath("$PROJECT_ROOT") + public class Annotations { + @Test + public void testAllFilesPresentInAnnotations() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/annotations"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("kt55286.kt") + public void testKt55286() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt"); + } + } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java index a7f8e4f859c..d48d0278bb8 100644 --- a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java +++ b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java @@ -569,6 +569,24 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt"); } + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/annotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Annotations extends AbstractLazyBodyIsNotTouchedTilContractsPhaseTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInAnnotations() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/annotations"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("kt55286.kt") + public void testKt55286() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt"); + } + } + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.fir.txt b/compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.fir.txt new file mode 100644 index 00000000000..f02e0bd3fdd --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.fir.txt @@ -0,0 +1,32 @@ +FILE: kt55286.kt + public final annotation class Deprecated : R|kotlin/Annotation| { + public constructor(): R|Deprecated| { + super() + } + + } + public open class Base : R|kotlin/Any| { + public constructor(@R|Deprecated|() a: R|kotlin/String|): R|Base| { + super() + } + + @R|Deprecated|() public final val a: R|kotlin/String| = R|/a| + public get(): R|kotlin/String| + + public final class Nested : R|kotlin/Any| { + public constructor(): R|Base.Nested| { + super() + } + + } + + } + public final class Derived : R|Base| { + public constructor(@R|Deprecated|() b: R|kotlin/String|): R|Derived| { + super(String()) + } + + @R|Deprecated|() public final val b: R|kotlin/String| = R|/b| + public get(): R|kotlin/String| + + } diff --git a/compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt b/compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt new file mode 100644 index 00000000000..8040eecf4c1 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt @@ -0,0 +1,13 @@ +// ISSUE: KT-55286 + +annotation class Deprecated + +open class Base( + @Deprecated<Nested> val a: String, +) { + class Nested +} + +class Derived( + @Deprecated<Nested> val b: String, +) : Base("") diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java index 40177b87712..b3f43199a04 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java @@ -674,6 +674,22 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest { runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt"); } + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/annotations") + @TestDataPath("$PROJECT_ROOT") + public class Annotations { + @Test + public void testAllFilesPresentInAnnotations() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/annotations"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("kt55286.kt") + public void testKt55286() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt"); + } + } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java index 820045a5b41..232fae1d75e 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java @@ -674,6 +674,22 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos runTest("compiler/fir/analysis-tests/testData/resolve/whenWithWhenAsStatement.kt"); } + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/annotations") + @TestDataPath("$PROJECT_ROOT") + public class Annotations { + @Test + public void testAllFilesPresentInAnnotations() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/annotations"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("kt55286.kt") + public void testKt55286() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/annotations/kt55286.kt"); + } + } + @Nested @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments") @TestDataPath("$PROJECT_ROOT")