[IR] Change value classes lowering dispatching strategy
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com> #KT-1179
This commit is contained in:
committed by
Space Team
parent
c1ac580031
commit
2535a87f85
@@ -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"
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
@kotlin.Metadata
|
||||
public final class A {
|
||||
// source: 'nestedLoweringStart.kt'
|
||||
public method <init>(): void
|
||||
public final method b-1Nq-99U(p0: double, p1: double): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class NestedLoweringStartKt {
|
||||
// source: 'nestedLoweringStart.kt'
|
||||
private static @org.jetbrains.annotations.Nullable field res: java.lang.Object
|
||||
static method <clinit>(): void
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.Nullable method getRes(): java.lang.Object
|
||||
public final static method setRes(@org.jetbrains.annotations.Nullable p0: java.lang.Object): void
|
||||
private final static method toA$g(p0: A, p1: java.util.List): void
|
||||
public final static @org.jetbrains.annotations.NotNull method toA(@org.jetbrains.annotations.NotNull p0: A): A
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class Point {
|
||||
// source: 'nestedLoweringStart.kt'
|
||||
private final field x: double
|
||||
private final field y: double
|
||||
private synthetic method <init>(p0: double, p1: double): void
|
||||
public synthetic final static method box-impl(p0: double, p1: double): Point
|
||||
public final static method constructor-impl(p0: double, p1: double): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: double, p1: double, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: double, p1: double, p2: double, p3: double): boolean
|
||||
public final method getX(): double
|
||||
public final method getY(): double
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: double, p1: double): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: double, p1: double): java.lang.String
|
||||
public synthetic final method unbox-impl-x(): double
|
||||
public synthetic final method unbox-impl-y(): double
|
||||
}
|
||||
Reference in New Issue
Block a user