[KAPT] KT-65453 Disable generation of type annotations in Java stubs
A workaround for KT-65608 Merge-request: KT-MR-14236 Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
18c08eb9ff
commit
f81b1150b2
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* public final annotation class A : kotlin/Annotation {
|
||||
*
|
||||
* // signature: <init>()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>): 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<? super kotlin.jvm.functions.Function0<kotlin.Unit>, kotlin.Unit> callback) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class A
|
||||
|
||||
|
||||
fun foo(callback: @A (parameter: (() -> Unit)) -> Unit) { }
|
||||
@@ -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: <init>()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>): 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<? super kotlin.jvm.functions.Function0<kotlin.Unit>, kotlin.Unit> callback) {
|
||||
}
|
||||
}
|
||||
@@ -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<java.lang.@org.jetbrains.A() String> 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<java.lang.String> x, @org.jetbrains.annotations.NotNull()
|
||||
org.jetbrains.Outer.Inner y, int z) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user