Files
kotlin-fork/compiler/testData/ir/irText/expressions/kt30020.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

31 lines
520 B
Kotlin
Vendored

// WITH_STDLIB
interface X {
val xs: MutableList<Any>
fun f(): MutableList<Any>
}
fun test(x: X, nx: X?) {
x.xs += 1
x.f() += 2
(x.xs as MutableList<Int>) += 3
(x.f() as MutableList<Int>) += 4
nx?.xs!! += 5
nx?.f()!! += 6
}
fun MutableList<Any>.testExtensionReceiver() {
this += 100
}
abstract class AML : MutableList<Int> {
fun testExplicitThis() {
this += 200
}
inner class Inner {
fun testOuterThis() {
this@AML += 300
}
}
}