[K/N] don't rely on expression type when lowering value constructor calls

Because of generics, these types don't exactly match the actual types in
generated code, and autoboxing can't fix this because this happens after
it.

^KT-48381 Fixed
This commit is contained in:
Svyatoslav Scherbina
2021-08-25 12:18:55 +03:00
committed by Space
parent aaf666e0e1
commit 01272cace3
@@ -457,7 +457,7 @@ private class InlineClassTransformer(private val context: Context) : IrBuildingT
this.at(expression)
val loweredConstructor = this@InlineClassTransformer.context.getLoweredInlineClassConstructor(callee)
return if (callee.isPrimary) this.irBlock {
val argument = irTemporary(expression.getValueArgument(0)!!)
val argument = irTemporary(expression.getValueArgument(0)!!, irType = loweredConstructor.valueParameters.single().type)
+irCall(loweredConstructor).apply {
putValueArgument(0, irGet(argument))
}