[IR] Change value classes lowering dispatching strategy

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

#KT-1179
This commit is contained in:
Evgeniy.Zhelenskiy
2023-03-29 07:46:05 +02:00
committed by Space Team
parent c1ac580031
commit 2535a87f85
15 changed files with 276 additions and 212 deletions
@@ -0,0 +1,35 @@
// WITH_STDLIB
// TARGET_BACKEND: JVM_IR
// LANGUAGE: +ValueClasses
// CHECK_BYTECODE_LISTING
// FIR_IDENTICAL
@JvmInline
value class Point(val x: Double, val y: Double)
class A {
fun b(p: Point) {
res = p
}
}
var res: Any? = null
fun toA(out: A): A {
fun g(p: List<Point>) {
out.b(p.first())
}
g(listOf(Point(1.0, 2.0)))
return out
}
fun box(): String {
val a = A()
toA(a)
require(res.toString() == Point(1.0, 2.0).toString())
return "OK"
}