diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/complex.txt b/compiler/testData/codegen/asmLike/typeAnnotations/complex.txt index 603cf4b158b..8a2ccf0e251 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/complex.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/complex.txt @@ -14,6 +14,7 @@ public abstract interface foo/Ann4 : java/lang/Object, java/lang/annotation/Anno } +Ljava/lang/Object; public final class foo/Bar : java/lang/Object { public void () } @@ -21,31 +22,37 @@ public final class foo/Bar : java/lang/Object { public final class foo/Kotlin : java/lang/Object { public void () + (Lfoo/Bar;)V public final void foo(foo.Bar s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lfoo/Ann2;([]) : METHOD_FORMAL_PARAMETER 0, 0; @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()Lfoo/Bar; public final foo.Bar foo() @Lorg/jetbrains/annotations/Nullable;([]) // invisible @Lfoo/Ann;([]) : METHOD_RETURN, null @Lfoo/Ann2;([]) : METHOD_RETURN, 0; + (TT;)V public final void foo(java.lang.Object s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null + ([Lfoo/Bar;)V public final void fooArray(foo.Bar[] s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lfoo/Ann2;([]) : METHOD_FORMAL_PARAMETER 0, [ @Lfoo/Ann3;([]) : METHOD_FORMAL_PARAMETER 0, [0; @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()[Lfoo/Bar; public final foo.Bar[] fooArray() @Lorg/jetbrains/annotations/Nullable;([]) // invisible @Lfoo/Ann;([]) : METHOD_RETURN, null @Lfoo/Ann2;([]) : METHOD_RETURN, [ @Lfoo/Ann3;([]) : METHOD_RETURN, [0; + ([[Lfoo/Bar;)V public final void fooArrayArray(foo.Bar[][] s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lfoo/Ann2;([]) : METHOD_FORMAL_PARAMETER 0, [ @@ -53,6 +60,7 @@ public final class foo/Kotlin : java/lang/Object { @Lfoo/Ann4;([]) : METHOD_FORMAL_PARAMETER 0, [[0; @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()[[Lfoo/Bar; public final foo.Bar[][] fooArrayArray() @Lorg/jetbrains/annotations/Nullable;([]) // invisible @Lfoo/Ann;([]) : METHOD_RETURN, null @@ -60,6 +68,7 @@ public final class foo/Kotlin : java/lang/Object { @Lfoo/Ann3;([]) : METHOD_RETURN, [[ @Lfoo/Ann4;([]) : METHOD_RETURN, [[0; + (Lfoo/Bar;)V public final void fooGeneric(foo.Bar s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lfoo/Ann2;([]) : METHOD_FORMAL_PARAMETER 0, 0; diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.txt b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.txt index 4b0fd945f43..2f205a14ffb 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.txt @@ -1,9 +1,11 @@ final class foo/Kotlin$A : foo/Kotlin { + ()V void (java.lang.String $enum$name, int $enum$ordinal) public final void foo() } +Ljava/lang/Enum; public class foo/Kotlin : java/lang/Enum { private final static foo.Kotlin[] $VALUES @@ -11,6 +13,7 @@ public class foo/Kotlin : java/lang/Enum { static void () + (Ljava/lang/String;)V private void (java.lang.String $enum$name, int $enum$ordinal, java.lang.String s) @Lfoo/TypeAnn;([]) : METHOD_FORMAL_PARAMETER 0, null diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/implicit.txt b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.txt index 4144e48dbd1..cc7fa96600f 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/implicit.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/implicit.txt @@ -1,3 +1,4 @@ +Lkotlin/jvm/internal/Lambda;Lkotlin/jvm/functions/Function0; final class foo/Kotlin$foo4$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functions/Function0 { final foo.Kotlin this$0 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.txt b/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.txt index 975a1eca163..3e6ea6e23c9 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.txt @@ -1,6 +1,7 @@ public final class foo/Kotlin$Inner : java/lang/Object { final foo.Kotlin this$0 + (Ljava/lang/String;)V public void (foo.Kotlin this$0, java.lang.String s) @Lfoo/TypeAnn;([]) : METHOD_FORMAL_PARAMETER 0, null @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.txt b/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.txt index 3c9c8279537..e573f01d14f 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.txt @@ -14,6 +14,7 @@ public abstract interface foo/Ann4 : java/lang/Object, java/lang/annotation/Anno } +Ljava/lang/Object; public final class foo/Bar : java/lang/Object { public void () } @@ -21,16 +22,20 @@ public final class foo/Bar : java/lang/Object { public final class foo/Kotlin : java/lang/Object { public void () + (Lfoo/Outer$Inner;)V public final void foo(foo.Outer$Inner s) @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()Lfoo/Outer$Inner; public final foo.Outer$Inner foo() @Lorg/jetbrains/annotations/Nullable;([]) // invisible + ([Lfoo/Outer$Inner;)V public final void fooArray(foo.Outer$Inner[] s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()[Lfoo/Outer$Inner; public final foo.Outer$Inner[] fooArray() @Lorg/jetbrains/annotations/Nullable;([]) // invisible @Lfoo/Ann;([]) : METHOD_RETURN, null @@ -39,22 +44,27 @@ public final class foo/Kotlin : java/lang/Object { @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()[Lfoo/Outer$Inner; public final foo.Outer$Inner[] fooArrayOut() @Lorg/jetbrains/annotations/Nullable;([]) // invisible @Lfoo/Ann;([]) : METHOD_RETURN, null + (Lfoo/Bar<-TT;>;)V public final void fooGenericIn(foo.Bar s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + (Lfoo/Bar<+TT;>;)V public final void fooGenericOut(foo.Bar s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 } +Ljava/lang/Object; public final class foo/Outer$Inner : java/lang/Object { final foo.Outer this$0 + ()V public void (foo.Outer this$0) } diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.txt b/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.txt index 1ca9cf30d89..53fe2f2474c 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/staticNested.txt @@ -14,6 +14,7 @@ public abstract interface foo/Ann4 : java/lang/Object, java/lang/annotation/Anno } +Ljava/lang/Object; public final class foo/Bar : java/lang/Object { public void () } @@ -21,22 +22,26 @@ public final class foo/Bar : java/lang/Object { public final class foo/Kotlin : java/lang/Object { public void () + (Lfoo/Outer$NestedStatic;)V public final void foo(foo.Outer$NestedStatic s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lfoo/Ann2;([]) : METHOD_FORMAL_PARAMETER 0, 0; @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()Lfoo/Outer$NestedStatic; public final foo.Outer$NestedStatic foo() @Lorg/jetbrains/annotations/Nullable;([]) // invisible @Lfoo/Ann;([]) : METHOD_RETURN, null @Lfoo/Ann2;([]) : METHOD_RETURN, 0; + ([Lfoo/Outer$NestedStatic;)V public final void fooArray(foo.Outer$NestedStatic[] s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lfoo/Ann2;([]) : METHOD_FORMAL_PARAMETER 0, [ @Lfoo/Ann3;([]) : METHOD_FORMAL_PARAMETER 0, [0; @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()[Lfoo/Outer$NestedStatic; public final foo.Outer$NestedStatic[] fooArray() @Lorg/jetbrains/annotations/Nullable;([]) // invisible @Lfoo/Ann;([]) : METHOD_RETURN, null @@ -47,19 +52,23 @@ public final class foo/Kotlin : java/lang/Object { @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + ()[Lfoo/Outer$NestedStatic; public final foo.Outer$NestedStatic[] fooArrayOut() @Lorg/jetbrains/annotations/Nullable;([]) // invisible @Lfoo/Ann;([]) : METHOD_RETURN, null + (Lfoo/Bar<-TT;>;)V public final void fooGenericIn(foo.Bar s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 + (Lfoo/Bar<+TT;>;)V public final void fooGenericOut(foo.Bar s) @Lfoo/Ann;([]) : METHOD_FORMAL_PARAMETER 0, null @Lorg/jetbrains/annotations/NotNull;([]) // invisible, parameter 0 } +Ljava/lang/Object; public final class foo/Outer$NestedStatic : java/lang/Object { public void () } diff --git a/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.txt b/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.txt index dba3dab6368..d9f6f328d9a 100644 --- a/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.txt +++ b/compiler/testData/codegen/asmLike/typeAnnotations/syntheticAccessors.txt @@ -1,6 +1,7 @@ public final class foo/Kotlin$A : java/lang/Object { final foo.Kotlin this$0 + ()V public void (foo.Kotlin this$0) public final void fooArray2() diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt index 79725349343..e400833a24f 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt @@ -65,6 +65,11 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { val superTypes = (listOf(clazz.superName) + clazz.interfaces).filterNotNull() return buildString { + if (renderAnnotations) { + clazz.signature?.let { + append(it).append("\n") + } + } renderVisibilityModifiers(clazz.access) renderModalityModifiers(clazz.access) append(if ((clazz.access and ACC_INTERFACE) != 0) "interface " else "class ") @@ -92,6 +97,11 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { } private fun renderField(field: FieldNode, renderAnnotations: Boolean) = buildString { + if (renderAnnotations) { + field.signature?.let { + append(it).append("\n") + } + } renderVisibilityModifiers(field.access) renderModalityModifiers(field.access) append(Type.getType(field.desc).className).append(' ') @@ -126,6 +136,12 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { showLocalVariables: Boolean, renderAnnotations: Boolean ) = buildString { + if (renderAnnotations) { + method.signature?.let { + append(it).append("\n") + } + } + renderVisibilityModifiers(method.access) renderModalityModifiers(method.access) val (returnType, parameterTypes) = with(Type.getMethodType(method.desc)) { returnType to argumentTypes } @@ -140,6 +156,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { if (renderAnnotations) { val textifier = Textifier() val visitor = TraceMethodVisitor(textifier) + method.visibleAnnotations?.forEach { it.accept(visitor.visitAnnotation(it.desc, true)) }