Files
kotlin/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNull.kt
Dmitry Petrov 08885e273b Support additional intrinsics in null check elimination
1. checkExpressionValueIsNotNull implies checked value is non-null

2. throwNpe never returns

 #KT-18162 Fixed Target versions 1.1.4
 #KT-18164 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00

23 lines
282 B
Kotlin
Vendored

// FILE: j/J.java
package j;
public class J {
public static final String ok() { return "OK"; }
}
// FILE: k.kt
import j.J
fun foo(a: Any) {}
fun test() {
val a = J.ok()
foo(a)
if (a == null) foo("NULL-1")
}
// @KKt.class:
// 0 IFNULL
// 0 IFNONNULL
// 0 NULL-1