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:
Steven Schäfer
2022-01-27 14:08:43 +01:00
committed by Alexander Udalov
parent aa6ba18c39
commit 78d80181e2
7 changed files with 31 additions and 2 deletions
@@ -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/");
@@ -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/");
@@ -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
}