diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirMetadataCalculator.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirMetadataCalculator.kt index 048ec44ca2a..b4a6c2d2789 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirMetadataCalculator.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirMetadataCalculator.kt @@ -93,7 +93,7 @@ internal class KtFirMetadataCalculator(override val analysisSession: KtFirAnalys for (fir in declarations) { if (fir !is FirFunction && fir !is FirProperty && fir !is FirTypeAlias) continue - fir.symbol.lazyResolveToPhase(FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE) + fir.symbol.lazyResolveToPhase(FirResolvePhase.ANNOTATIONS_ARGUMENTS_MAPPING) val psiElements = mapping[fir.psi as KtElement] val methods = psiElements.filterIsInstance() diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.fir.txt new file mode 100644 index 00000000000..12a3c9e03b2 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.fir.txt @@ -0,0 +1,63 @@ +package a; + +/** + * public final annotation class a/LinkifyMask : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ +@kotlin.Metadata() +@b.RestrictTo(value = {b.RestrictTo.Scope.LIBRARY_GROUP_PREFIX}) +@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +public abstract @interface LinkifyMask { +} + +//////////////////// + +package a; + +/** + * public final object a/SphinxLinkify : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: addLinks(I)V + * private final fun addLinks(mask: kotlin/Int): kotlin/Unit + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class SphinxLinkify { + @org.jetbrains.annotations.NotNull() + public static final a.SphinxLinkify INSTANCE = null; + + private SphinxLinkify() { + super(); + } + + private final void addLinks(@LinkifyMask() + int mask) { + } +} + +//////////////////// + +package b; + +public @interface RestrictTo { + + Scope[] value(); + + public static enum Scope { + /*public static final*/ LIBRARY_GROUP_PREFIX /* = new Scope() */; + + private Scope() { + super(); + } + } +} diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.kt b/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.kt new file mode 100644 index 00000000000..9fe10a09a01 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.kt @@ -0,0 +1,27 @@ +// FULL_JDK + +// FILE: a/LinkifyMask.kt +package a + +import b.RestrictTo + +object SphinxLinkify { + private fun addLinks( + @LinkifyMask mask: Int + ) {} +} + +@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) +annotation class LinkifyMask + +// FILE: b/RestrictTo.java + +package b; + +public @interface RestrictTo { + Scope[] value(); + + enum Scope { + LIBRARY_GROUP_PREFIX, + } +} \ No newline at end of file diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.txt new file mode 100644 index 00000000000..29b734dc08a --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt61729.txt @@ -0,0 +1,63 @@ +package a; + +@b.RestrictTo(value = {b.RestrictTo.Scope.LIBRARY_GROUP_PREFIX}) +@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +/** + * public final annotation class a/LinkifyMask : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ +@kotlin.Metadata() +public abstract @interface LinkifyMask { +} + +//////////////////// + +package a; + +/** + * public final object a/SphinxLinkify : kotlin/Any { + * + * // signature: ()V + * private constructor() + * + * // signature: addLinks(I)V + * private final fun addLinks(mask: kotlin/Int): kotlin/Unit + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class SphinxLinkify { + @org.jetbrains.annotations.NotNull() + public static final a.SphinxLinkify INSTANCE = null; + + private SphinxLinkify() { + super(); + } + + private final void addLinks(@LinkifyMask() + int mask) { + } +} + +//////////////////// + +package b; + +public @interface RestrictTo { + + Scope[] value(); + + public static enum Scope { + /*public static final*/ LIBRARY_GROUP_PREFIX /* = new Scope() */; + + private Scope() { + super(); + } + } +} diff --git a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java index 6591c50bac6..39a3fb23ff9 100644 --- a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java +++ b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/ClassFileToSourceStubConverterTestGenerated.java @@ -487,6 +487,12 @@ public class ClassFileToSourceStubConverterTestGenerated extends AbstractClassFi runTest("plugins/kapt3/kapt3-compiler/testData/converter/kt43786.kt"); } + @Test + @TestMetadata("kt61729.kt") + public void testKt61729() throws Exception { + runTest("plugins/kapt3/kapt3-compiler/testData/converter/kt61729.kt"); + } + @Test @TestMetadata("lazyProperty.kt") public void testLazyProperty() throws Exception { diff --git a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java index f06a6a406ac..463cdf1ab76 100644 --- a/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java +++ b/plugins/kapt3/kapt3-compiler/tests-gen/org/jetbrains/kotlin/kapt3/test/runners/IrClassFileToSourceStubConverterTestGenerated.java @@ -487,6 +487,12 @@ public class IrClassFileToSourceStubConverterTestGenerated extends AbstractIrCla runTest("plugins/kapt3/kapt3-compiler/testData/converter/kt43786.kt"); } + @Test + @TestMetadata("kt61729.kt") + public void testKt61729() throws Exception { + runTest("plugins/kapt3/kapt3-compiler/testData/converter/kt61729.kt"); + } + @Test @TestMetadata("lazyProperty.kt") public void testLazyProperty() throws Exception { diff --git a/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java b/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java index 83a30573285..8a9188364d6 100644 --- a/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java +++ b/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java @@ -487,6 +487,12 @@ public class KotlinKapt4ContextTestGenerated extends AbstractKotlinKapt4ContextT runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/kt43786.kt"); } + @Test + @TestMetadata("kt61729.kt") + public void testKt61729() throws Exception { + runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/kt61729.kt"); + } + @Test @TestMetadata("lazyProperty.kt") public void testLazyProperty() throws Exception {