Fix annotations loading for inline class constructors
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||
inline class Z @PublishedApi internal constructor(val value: Int)
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
@kotlin.Metadata
|
||||
public final class Z {
|
||||
private final field value: int
|
||||
private synthetic @kotlin.PublishedApi method <init>(p0: int): void
|
||||
public synthetic final static @org.jetbrains.annotations.NotNull method box-impl(p0: int): Z
|
||||
public static @kotlin.PublishedApi method constructor-impl(p0: int): int
|
||||
public method equals(p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int): boolean
|
||||
public final method getValue(): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int): int
|
||||
public method toString(): java.lang.String
|
||||
public static @org.jetbrains.annotations.NotNull method toString-impl(p0: int): java.lang.String
|
||||
public synthetic final method unbox-impl(): int
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
@file:Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||
package test
|
||||
|
||||
|
||||
inline class Z @PublishedApi internal constructor(val value: Int)
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
public final inline class Z {
|
||||
/*primary*/ @kotlin.PublishedApi internal constructor Z(/*0*/ value: kotlin.Int)
|
||||
public final val value: kotlin.Int
|
||||
public final fun <get-value>(): kotlin.Int
|
||||
}
|
||||
+5
@@ -319,6 +319,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/primaryValsWithDifferentVisibilities.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publishedApiAnnotationOnInlineClassConstructor.kt")
|
||||
public void testPublishedApiAnnotationOnInlineClassConstructor() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/publishedApiAnnotationOnInlineClassConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("shapeOfInlineClassWithPrimitive.kt")
|
||||
public void testShapeOfInlineClassWithPrimitive() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/shapeOfInlineClassWithPrimitive.kt");
|
||||
|
||||
@@ -1799,6 +1799,11 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PublishedApiAnnotationOnInlineClassCosntructor.kt")
|
||||
public void testPublishedApiAnnotationOnInlineClassCosntructor() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PublishedApiAnnotationOnInlineClassCosntructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Setter.kt")
|
||||
public void testSetter() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/Setter.kt");
|
||||
|
||||
Generated
+5
@@ -143,6 +143,11 @@ public class LoadKotlinWithTypeTableTestGenerated extends AbstractLoadKotlinWith
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PublishedApiAnnotationOnInlineClassCosntructor.kt")
|
||||
public void testPublishedApiAnnotationOnInlineClassCosntructor() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PublishedApiAnnotationOnInlineClassCosntructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Setter.kt")
|
||||
public void testSetter() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/Setter.kt");
|
||||
|
||||
Generated
+5
@@ -1799,6 +1799,11 @@ public class LoadJavaUsingJavacTestGenerated extends AbstractLoadJavaUsingJavacT
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PublishedApiAnnotationOnInlineClassCosntructor.kt")
|
||||
public void testPublishedApiAnnotationOnInlineClassCosntructor() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PublishedApiAnnotationOnInlineClassCosntructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Setter.kt")
|
||||
public void testSetter() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/Setter.kt");
|
||||
|
||||
+6
-1
@@ -86,6 +86,11 @@ object JvmProtoBufUtil {
|
||||
typeTable: TypeTable
|
||||
): JvmMemberSignature.Method? {
|
||||
val signature = proto.getExtensionOrNull(JvmProtoBuf.constructorSignature)
|
||||
val name = if (signature != null && signature.hasName()) {
|
||||
nameResolver.getString(signature.name)
|
||||
} else {
|
||||
"<init>"
|
||||
}
|
||||
val desc = if (signature != null && signature.hasDesc()) {
|
||||
nameResolver.getString(signature.desc)
|
||||
} else {
|
||||
@@ -93,7 +98,7 @@ object JvmProtoBufUtil {
|
||||
mapTypeDefault(it.type(typeTable), nameResolver) ?: return null
|
||||
}.joinToString(separator = "", prefix = "(", postfix = ")V")
|
||||
}
|
||||
return JvmMemberSignature.Method("<init>", desc)
|
||||
return JvmMemberSignature.Method(name, desc)
|
||||
}
|
||||
|
||||
fun getJvmFieldSignature(
|
||||
|
||||
Generated
+5
@@ -143,6 +143,11 @@ public class LoadJavaClsStubTestGenerated extends AbstractLoadJavaClsStubTest {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PublishedApiAnnotationOnInlineClassCosntructor.kt")
|
||||
public void testPublishedApiAnnotationOnInlineClassCosntructor() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PublishedApiAnnotationOnInlineClassCosntructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Setter.kt")
|
||||
public void testSetter() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/Setter.kt");
|
||||
|
||||
@@ -143,6 +143,11 @@ public class ResolveByStubTestGenerated extends AbstractResolveByStubTest {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PropertyField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PublishedApiAnnotationOnInlineClassCosntructor.kt")
|
||||
public void testPublishedApiAnnotationOnInlineClassCosntructor() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/PublishedApiAnnotationOnInlineClassCosntructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Setter.kt")
|
||||
public void testSetter() throws Exception {
|
||||
runTest("compiler/testData/loadJava/compiledKotlin/annotations/classMembers/Setter.kt");
|
||||
|
||||
Reference in New Issue
Block a user