mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
New null check assertions are generated a bit more efficiently, with a call to `checkNotNull` instead of IFNONNULL+jump.
24 lines
317 B
Kotlin
Vendored
24 lines
317 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()
|
|
a!!
|
|
foo(a)
|
|
if (a == null) foo("NULL-1")
|
|
}
|
|
|
|
// @KKt.class:
|
|
// 0 IFNULL
|
|
// 1 checkNotNull \(Ljava/lang/Object;\)V
|
|
// 0 NULL-1 |