Files
kotlin-fork/compiler/testData/ir/irText/expressions/kt23030.kt.txt
T
2020-11-26 00:14:13 +03:00

59 lines
1.2 KiB
Plaintext
Vendored

operator fun Int.compareTo(c: Char): Int {
return 0
}
fun testOverloadedCompareToCall(x: Int, y: Char): Boolean {
return less(arg0 = x.compareTo(c = y), arg1 = 0)
}
fun testOverloadedCompareToCallWithSmartCast(x: Any, y: Any): Boolean {
return when {
when {
x is Int -> y is Char
true -> false
} -> less(arg0 = x /*as Int */.compareTo(c = y /*as Char */), arg1 = 0)
true -> false
}
}
fun testEqualsWithSmartCast(x: Any, y: Any): Boolean {
return when {
when {
x is Int -> y is Char
true -> false
} -> EQEQ(arg0 = x, arg1 = y)
true -> false
}
}
class C {
constructor() /* primary */ {
TODO("IrDelegatingConstructorCall")
/* InstanceInitializerCall */
}
operator fun Int.compareTo(c: Char): Int {
return 0
}
fun testMemberExtensionCompareToCall(x: Int, y: Char): Boolean {
return less(arg0 = (<this>, x).compareTo(c = y), arg1 = 0)
}
fun testMemberExtensionCompareToCallWithSmartCast(x: Any, y: Any): Boolean {
return when {
when {
x is Int -> y is Char
true -> false
} -> less(arg0 = (<this>, x /*as Int */).compareTo(c = y /*as Char */), arg1 = 0)
true -> false
}
}
}