JVM_IR: Perform asm type conversion for string concat arguments.
This ensures that the Unit instance is loaded when string concatenation contains a sub part that is a call of a Unit return-type method.
This commit is contained in:
+1
-1
@@ -892,7 +892,7 @@ class ExpressionCodegen(
|
||||
// Use StringBuilder to concatenate.
|
||||
AsmUtil.genStringBuilderConstructor(mv)
|
||||
expression.arguments.forEach {
|
||||
val stackValue = gen(it, data)
|
||||
val stackValue = gen(it, it.asmType, data)
|
||||
AsmUtil.genInvokeAppendMethod(mv, stackValue.type, stackValue.kotlinType)
|
||||
}
|
||||
mv.invokevirtual("java/lang/StringBuilder", "toString", "()Ljava/lang/String;", false)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
data class A(val x: Unit)
|
||||
|
||||
fun box(): String {
|
||||
|
||||
Reference in New Issue
Block a user