Fix equality comparison of inline classes with primitive underlying type
^KT-54455 Fixed
This commit is contained in:
committed by
teamcity
parent
57f1405d95
commit
aeccc2e787
@@ -0,0 +1,17 @@
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
// LANGUAGE: +ValueClasses
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class IC1(val value: Int)
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class IC2(val value: Int)
|
||||
|
||||
fun foo(x: IC1, y: IC2) = (x as Any) == y
|
||||
|
||||
fun box(): String {
|
||||
if ((IC1(1) as Any) == IC2(1)) return "Fail 1"
|
||||
if (foo(IC1(1), IC2(1))) return "Fail 2"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user