JVM_IR more aggressive if-null expressions fusion

Assume that changing a return type from T to T?
is not a binary-compatible change.
This commit is contained in:
Dmitry Petrov
2021-08-04 18:53:06 +03:00
committed by teamcityserver
parent 6f0bf766f2
commit 02d8c7527e
15 changed files with 206 additions and 18 deletions
@@ -0,0 +1,18 @@
// MODULE: lib
// FILE: a.kt
class A(val x : Int, val y : A?)
// MODULE: main(lib)
// FILE: main.kt
fun check(a : A?) : Int {
return a?.y?.x ?: (a?.x ?: 3)
}
// 0 valueOf
// 0 Value\s\(\)
// JVM_TEMPLATES:
// 0 ACONST_NULL
// JVM_IR_TEMPLATES:
// 1 ACONST_NULL