Fix specialization of equality comparison calls for inline classes
Receiver of equals() call should be checked instead of argument ^KT-57261: Fixed
This commit is contained in:
committed by
teamcity
parent
8039e30bbd
commit
35dfcb61bb
@@ -0,0 +1,19 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
// LANGUAGE: +ValueClasses
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class Ic(val x: Int)
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val strAsAny : Any = "a"
|
||||
|
||||
if ("a".equals(Ic(1))) return "Fail 1"
|
||||
if (strAsAny.equals(Ic(1))) return "Fail 2"
|
||||
if (Ic(1).equals("a")) return "Fail 3"
|
||||
if (Ic(1).equals(strAsAny)) return "Fail 4"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user