[FIR] Map platform types to Kotlin for equality checks

During the DM it was decided to support
such comparisons, if I remember correctly.

^KT-62646
This commit is contained in:
Nikolay Lunyak
2024-02-27 12:29:18 +02:00
committed by Space Team
parent 6607c8a056
commit cd3202ddd4
2 changed files with 8 additions and 8 deletions
@@ -8,8 +8,8 @@ import checkSubtype
fun main(args : Array<String>) {
val x = checkSubtype<Any>(args[0])
if(x is <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.CharSequence<!>) {
if (<!EQUALITY_NOT_APPLICABLE_WARNING!>"a" == x<!>) x.length else x.length() // OK
if (<!EQUALITY_NOT_APPLICABLE_WARNING!>"a" == x<!> || <!EQUALITY_NOT_APPLICABLE_WARNING!>"b" == x<!>) x.length else x.length() // < THEN ERROR
if (<!EQUALITY_NOT_APPLICABLE_WARNING!>"a" == x<!> && "a" == x) x.length else x.length() // < ELSE ERROR
if ("a" == x) x.length else x.length() // OK
if ("a" == x || "b" == x) x.length else x.length() // < THEN ERROR
if ("a" == x && "a" == x) x.length else x.length() // < ELSE ERROR
}
}