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 e99128d4b10..cba71288aec 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 @@ -4018,6 +4018,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test + @TestMetadata("annotationUseSites.kt") + public void testAnnotationUseSites() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.kt"); + } + @Test @TestMetadata("arrayFilterCapturedType.kt") public void testArrayFilterCapturedType() throws Exception { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.fir.txt new file mode 100644 index 00000000000..76946258f0b --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.fir.txt @@ -0,0 +1,38 @@ +FILE: test.kt + @R|kotlin/annotation/Target|(allowedTargets = vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.VALUE_PARAMETER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_GETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.PROPERTY_SETTER|, Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.CONSTRUCTOR|)) public final annotation class KotlinMessage : R|kotlin/Annotation| { + public constructor(): R|KotlinMessage| { + super() + } + + } + public final data class KotlinResult : R|kotlin/Any| { + @R|KotlinMessage|() public constructor(@PROPERTY_GETTER:R|KotlinMessage|() @R|KotlinMessage|() message: R|kotlin/String| = String()): R|KotlinResult| { + super() + } + + @PROPERTY_GETTER:R|KotlinMessage|() @R|KotlinMessage|() public final val message: R|kotlin/String| = R|/message| + public get(): R|kotlin/String| + + public final operator fun component1(): R|kotlin/String| + + public final fun copy(message: R|kotlin/String| = this@R|/KotlinResult|.R|/KotlinResult.message|): R|KotlinResult| + + } + public open class Some : R|kotlin/Any| { + public constructor(): R|Some| { + super() + } + + public final companion object Companion : R|kotlin/Any| { + private constructor(): R|Some.Companion| { + super() + } + + @PROPERTY_GETTER:R|kotlin/jvm/JvmName|(name = String(getInstance)) public open val INSTANCE: R|kotlin/String| + public get(): R|kotlin/String| { + ^ String(Omega) + } + + } + + } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.kt new file mode 100644 index 00000000000..af5a383ae8e --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.kt @@ -0,0 +1,13 @@ +// FILE: test.kt +@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.CONSTRUCTOR) +annotation class KotlinMessage + +data class KotlinResult @KotlinMessage constructor(@get:KotlinMessage @KotlinMessage val message: String = "") + +open class Some { + companion object { + @get:JvmName("getInstance") + open val INSTANCE: String + get() = "Omega" + } +} 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 29097a5e472..97f8806b884 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 @@ -4018,6 +4018,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test + @TestMetadata("annotationUseSites.kt") + public void testAnnotationUseSites() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.kt"); + } + @Test @TestMetadata("arrayFilterCapturedType.kt") public void testArrayFilterCapturedType() throws Exception { 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 da047f1b0b1..71fffaf664b 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 @@ -4018,6 +4018,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } + @Test + @TestMetadata("annotationUseSites.kt") + public void testAnnotationUseSites() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/annotationUseSites.kt"); + } + @Test @TestMetadata("arrayFilterCapturedType.kt") public void testArrayFilterCapturedType() throws Exception {