JVM_IR KT-49136 don't optimize null checks on fields and calls

This commit is contained in:
Dmitry Petrov
2021-10-07 16:44:29 +03:00
parent 9ef899ef10
commit 27860ef008
13 changed files with 116 additions and 2 deletions
@@ -0,0 +1,22 @@
abstract class Z {
init {
check(this)
}
abstract val b: B
}
class A(override val b: B) : Z()
class B(val c: String)
fun use(a: Any?) {}
fun check(z: Z) {
use(z?.b?.c)
}
fun box(): String {
A(B(""))
return "OK"
}