Files
kotlin-fork/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt
T
Denis.Zharkov 1e0d9f4075 FIR2IR: Do not add implicit casts for types with different nullability
For smart casts, elvises, etc., there are no implicit casts in psi2fir
in changed test data
2021-01-29 10:50:22 +03:00

59 lines
1.3 KiB
Plaintext
Vendored

interface X {
abstract val xs: MutableList<Any>
abstract get
abstract fun f(): MutableList<Any>
}
fun test(x: X, nx: X?) {
x.<get-xs>().plusAssign<Int>(element = 1)
x.f().plusAssign<Int>(element = 2)
x.<get-xs>() as MutableList<Int>.plusAssign<Int>(element = 3)
x.f() as MutableList<Int>.plusAssign<Int>(element = 4)
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
val tmp0_safe_receiver: X? = nx
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.<get-xs>()
}
}).plusAssign<Int>(element = 5)
CHECK_NOT_NULL<MutableList<Any>>(arg0 = { // BLOCK
val tmp1_safe_receiver: X? = nx
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver.f()
}
}).plusAssign<Int>(element = 6)
}
fun MutableList<Any>.testExtensionReceiver() {
<this>.plusAssign<Int>(element = 100)
}
abstract class AML : MutableList<Int> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun testExplicitThis() {
<this>.plusAssign<Int>(element = 200)
}
inner class Inner {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun testOuterThis() {
<this>.plusAssign<Int>(element = 300)
}
}
}