[IR] Fix inline class constructors having MFVC parameters

Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
This commit is contained in:
Evgeniy.Zhelenskiy
2023-05-11 21:41:54 +02:00
committed by Space Team
parent 2535a87f85
commit 07576b03c4
11 changed files with 110 additions and 15 deletions
@@ -0,0 +1,22 @@
// LANGUAGE: +ValueClasses
// TARGET_BACKEND: JVM_IR
// CHECK_BYTECODE_LISTING
// WITH_STDLIB
// CHECK_BYTECODE_TEXT
// FIR_IDENTICAL
@JvmInline
value class IC(val x: Int) {
constructor(mfvc: MFVC) : this(mfvc.x + mfvc.y)
}
@JvmInline
value class MFVC(val x: Int, val y: Int) {
constructor(ic: IC) : this(ic.x, ic.x)
}
fun box(): String {
require(IC(MFVC(1, 2)) == IC(3))
require(MFVC(IC(1)) == MFVC(1, 1))
return "OK"
}