IR: use inlineClassRepresentation in getInlineClassUnderlyingType

Looking for the primary constructor manually doesn't work if it's
private in the other module on JVM, because private declarations are
skipped in IrLazyClass.
This commit is contained in:
Alexander Udalov
2021-08-12 13:13:26 +02:00
parent 66dbd91851
commit 8d4f26cf84
13 changed files with 88 additions and 14 deletions
@@ -481,8 +481,7 @@ internal class LambdaMetafactoryArgumentsBuilder(
if (erasedAdapteeClass.isInline) {
// Inline classes mapped to non-null reference types are a special case because they can't be boxed trivially.
// TODO consider adding a special type annotation to force boxing on an inline class type regardless of its underlying type.
val underlyingAdapteeType = getInlineClassUnderlyingType(erasedAdapteeClass) as? IrSimpleType
?: throw AssertionError("Underlying type for inline class should be a simple type: ${erasedAdapteeClass.render()}")
val underlyingAdapteeType = getInlineClassUnderlyingType(erasedAdapteeClass)
if (!underlyingAdapteeType.hasQuestionMark && !underlyingAdapteeType.isPrimitiveType()) {
return TypeAdaptationConstraint.CONFLICT
}