Fix equality comparison for inline class over inline class

^KT-54536: Fixed
This commit is contained in:
vladislav.grechko
2022-10-20 21:29:21 +02:00
committed by teamcity
parent db133bedf9
commit 6f4a60ac91
5 changed files with 126 additions and 3 deletions
+18
View File
@@ -0,0 +1,18 @@
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +CustomEqualsInInlineClasses
// TARGET_BACKEND: JVM_IR
OPTIONAL_JVM_INLINE_ANNOTATION
value class A(val x: Int) {
fun equals(other: A) = x % 5 == other.x % 5
}
OPTIONAL_JVM_INLINE_ANNOTATION
value class B(val x: A)
fun box() = if (B(A(0)) == B(A(5))) "OK" else "Fail"
// CHECK_BYTECODE_TEXT
// 0 INVOKESTATIC B.box-impl
// 0 INVOKESTATIC A.box-impl