Files
kotlin/compiler/testData/codegen/bytecodeText/sam/samWrapperForNullableInitialization.kt
2018-12-21 16:20:45 +01:00

25 lines
437 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// FILE: JFoo.java
import org.jetbrains.annotations.Nullable;
public class JFoo {
public static void foo2(@Nullable Runnable h1, @Nullable Runnable h2) {
if (h2 != null) throw new AssertionError();
h1.run();
}
}
// FILE: Test.kt
fun runnable(): (() -> Unit)? = null
fun test() {
JFoo.foo2({}, runnable())
}
// @TestKt.class:
// 2 NEW
// 0 IFNONNULL
// 1 IFNULL
// 1 ACONST_NULL