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

55 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
else -> false
} -> less(arg0 = x /*as Int */.compareTo(c = y /*as Char */), arg1 = 0)
else -> false
}
}
fun testEqualsWithSmartCast(x: Any, y: Any): Boolean {
return when {
when {
x is Int -> y is Char
else -> false
} -> EQEQ(arg0 = x /*as Int */, arg1 = y /*as Char */)
else -> false
}
}
class C {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
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
else -> false
} -> less(arg0 = (<this>, x /*as Int */).compareTo(c = y /*as Char */), arg1 = 0)
else -> false
}
}
}