Fix == for inline classes with boxes
TODO generalize code generating object vs primitive equality #KT-25914 Fixed #KT-25981 Fixed #KT-25983 Fixed
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR, JS
|
||||
|
||||
inline class Z(val value: Int)
|
||||
|
||||
fun eq(a: Z?, b: Z) = a == b
|
||||
|
||||
fun eqq(a: Z, b: Z?) = a == b
|
||||
|
||||
fun box(): String {
|
||||
if (!eq(Z(1), Z(1))) throw AssertionError()
|
||||
if (eq(Z(1), Z(2))) throw AssertionError()
|
||||
if (eq(null, Z(0))) throw AssertionError()
|
||||
|
||||
if (!eqq(Z(1), Z(1))) throw AssertionError()
|
||||
if (eqq(Z(1), Z(2))) throw AssertionError()
|
||||
if (eqq(Z(0), null)) throw AssertionError()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user