diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.fir.txt new file mode 100644 index 00000000000..eb03636dc24 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.fir.txt @@ -0,0 +1,39 @@ +/** + * public final annotation class A : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ +@kotlin.Metadata() +@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.TYPE}) +@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE_USE}) +@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +public abstract @interface A { +} + +//////////////////// + + +/** + * package { + * + * // signature: foo(Lkotlin/jvm/functions/Function1;)V + * public final fun foo(callback: @A kotlin/Function1<@kotlin/ParameterName(name = "parameter") kotlin/Function0, kotlin/Unit>): kotlin/Unit + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class Kt65453Kt { + + public Kt65453Kt() { + super(); + } + + public static final void foo(@org.jetbrains.annotations.NotNull() + kotlin.jvm.functions.Function1, kotlin.Unit> callback) { + } +} diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.kt b/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.kt new file mode 100644 index 00000000000..b9b0c888ce9 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.kt @@ -0,0 +1,5 @@ +@Target(AnnotationTarget.TYPE) +annotation class A + + +fun foo(callback: @A (parameter: (() -> Unit)) -> Unit) { } \ No newline at end of file diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.txt b/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.txt new file mode 100644 index 00000000000..8ab1dbb7bc3 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/kt65453.txt @@ -0,0 +1,39 @@ +@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.TYPE}) +@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME) +@java.lang.annotation.Target(value = {}) +/** + * public final annotation class A : kotlin/Annotation { + * + * // signature: ()V + * public constructor() + * + * // module name: main + * } + */ +@kotlin.Metadata() +public abstract @interface A { +} + +//////////////////// + + +/** + * package { + * + * // signature: foo(Lkotlin/jvm/functions/Function1;)V + * public final fun foo(callback: @A kotlin/Function1<@kotlin/ParameterName(name = "parameter") kotlin/Function0, kotlin/Unit>): kotlin/Unit + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class Kt65453Kt { + + public Kt65453Kt() { + super(); + } + + public static final void foo(@org.jetbrains.annotations.NotNull() + kotlin.jvm.functions.Function1, kotlin.Unit> callback) { + } +} diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/typeAnnotations.fir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/typeAnnotations.fir.txt index 4d94266a550..c3d69f6236f 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/typeAnnotations.fir.txt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/typeAnnotations.fir.txt @@ -77,10 +77,9 @@ public final class TypeAnnotationsKt { } @org.jetbrains.annotations.NotNull() - public static final java.lang.@org.jetbrains.A() String foo(@org.jetbrains.annotations.NotNull() - java.util.@org.jetbrains.A() List x, @org.jetbrains.annotations.NotNull() - org.jetbrains.Outer.@org.jetbrains.A() Inner y, @org.jetbrains.A() - int z) { + public static final java.lang.String foo(@org.jetbrains.annotations.NotNull() + java.util.List x, @org.jetbrains.annotations.NotNull() + org.jetbrains.Outer.Inner y, int z) { return null; } } 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 20815bcd9c3..874e25872c3 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 @@ -511,6 +511,12 @@ public class IrClassFileToSourceStubConverterTestGenerated extends AbstractIrCla runTest("plugins/kapt3/kapt3-compiler/testData/converter/kt61729.kt"); } + @Test + @TestMetadata("kt65453.kt") + public void testKt65453() throws Exception { + runTest("plugins/kapt3/kapt3-compiler/testData/converter/kt65453.kt"); + } + @Test @TestMetadata("lazyProperty.kt") public void testLazyProperty() throws Exception { diff --git a/plugins/kapt4/src/org/jetbrains/kotlin/kapt4/StubGenerator.kt b/plugins/kapt4/src/org/jetbrains/kotlin/kapt4/StubGenerator.kt index 82c99f681aa..c459886f90d 100644 --- a/plugins/kapt4/src/org/jetbrains/kotlin/kapt4/StubGenerator.kt +++ b/plugins/kapt4/src/org/jetbrains/kotlin/kapt4/StubGenerator.kt @@ -430,7 +430,7 @@ private class StubGenerator( private fun Printer.printType(type: PsiType) { recordErrorTypes(type) - printTypeSignature(type, true) + printTypeSignature(type, false) // TODO: Set to true when KT-65608 is fixed } private fun Printer.printTypeSignature(type: PsiType, annotated: Boolean) { 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 68c1896b4f0..dff5ff8f5b9 100644 --- a/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java +++ b/plugins/kapt4/tests-gen/org/jetbrains/kotlin/kapt4/KotlinKapt4ContextTestGenerated.java @@ -511,6 +511,12 @@ public class KotlinKapt4ContextTestGenerated extends AbstractKotlinKapt4ContextT runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/kt61729.kt"); } + @Test + @TestMetadata("kt65453.kt") + public void testKt65453() throws Exception { + runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/kt65453.kt"); + } + @Test @TestMetadata("lazyProperty.kt") public void testLazyProperty() throws Exception {