IC Mangling: Use correct java field type if the type is inline class

in JVM_IR BE.
 #KT-26445
This commit is contained in:
Ilmir Usmanov
2020-12-11 12:24:41 +01:00
parent 2b0a99b7b0
commit dc11c2de77
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.backend.jvm.JvmLoweredStatementOrigin
import org.jetbrains.kotlin.backend.jvm.intrinsics.IrIntrinsicMethods
import org.jetbrains.kotlin.backend.jvm.intrinsics.JavaClassProperty
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
import org.jetbrains.kotlin.backend.jvm.ir.isFromJava
import org.jetbrains.kotlin.backend.jvm.lower.MultifileFacadeFileEntry
import org.jetbrains.kotlin.backend.jvm.lower.constantValue
import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.unboxInlineClass
@@ -665,7 +666,8 @@ class ExpressionCodegen(
?: receiverType ?: typeMapper.mapClass(callee.parentAsClass)
val ownerName = ownerType.internalName
val fieldName = callee.name.asString()
val fieldType = callee.type.asmType
val calleeIrType = if (callee.isFromJava() && callee.type.isInlined()) callee.type.makeNullable() else callee.type
val fieldType = calleeIrType.asmType
return if (expression is IrSetField) {
val value = expression.value.accept(this, data)
// We only initialize enum entries with a subtype of `fieldType` and can avoid the CHECKCAST.