inlineClassUtils: Fix handling of inline classes without constructors
Fixes KT-50992 DeclarationDescriptor.isInlineClass misidentifies inline classes without constructors. This can happen for the ABI of inline classes with private constructors.
This commit is contained in:
committed by
Alexander Udalov
parent
aa6ba18c39
commit
78d80181e2
Generated
+5
@@ -115,6 +115,11 @@ public class CompileAgainstJvmAbiTestGenerated extends AbstractCompileAgainstJvm
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/privateOnlyConstructors/");
|
||||
}
|
||||
|
||||
@TestMetadata("privateValueClassConstructor")
|
||||
public void testPrivateValueClassConstructor() throws Exception {
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/privateValueClassConstructor/");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevel")
|
||||
public void testTopLevel() throws Exception {
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/topLevel/");
|
||||
|
||||
Generated
+5
@@ -115,6 +115,11 @@ public class IrCompileAgainstJvmAbiTestGenerated extends AbstractIrCompileAgains
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/privateOnlyConstructors/");
|
||||
}
|
||||
|
||||
@TestMetadata("privateValueClassConstructor")
|
||||
public void testPrivateValueClassConstructor() throws Exception {
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/privateValueClassConstructor/");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevel")
|
||||
public void testTopLevel() throws Exception {
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/topLevel/");
|
||||
|
||||
Generated
+5
@@ -115,6 +115,11 @@ public class LegacyCompileAgainstJvmAbiTestGenerated extends AbstractLegacyCompi
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/privateOnlyConstructors/");
|
||||
}
|
||||
|
||||
@TestMetadata("privateValueClassConstructor")
|
||||
public void testPrivateValueClassConstructor() throws Exception {
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/privateValueClassConstructor/");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevel")
|
||||
public void testTopLevel() throws Exception {
|
||||
runTest("plugins/jvm-abi-gen/testData/compile/topLevel/");
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package app
|
||||
|
||||
import lib.*
|
||||
|
||||
fun runAppAndReturnOk(): String {
|
||||
return A.a().b()
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package lib
|
||||
|
||||
@JvmInline
|
||||
value class A private constructor(val value: String) {
|
||||
companion object { fun a() = A("OK") }
|
||||
inline fun b() = value
|
||||
}
|
||||
Reference in New Issue
Block a user