Files
kotlin/compiler/testData/codegen/bytecodeText/sam/samWrapperForNullInitialization.kt
Dmitry Petrov 8a9707c140 Generate proper initialization for possibly nullable SAM wrapper
#KT-18916 Fixed Target versions 1.1.5
2017-07-12 09:37:16 +03:00

26 lines
509 B
Kotlin
Vendored

// WITH_RUNTIME
// 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 test() {
var i = 0
JFoo.foo2({ i++ }, null)
}
// @TestKt.class:
// 1 NEW TestKt\$test\$1
// 1 NEW kotlin/jvm/internal/Ref\$IntRef
// 2 NEW
// 1 INVOKESPECIAL TestKt\$test\$1.<init>
// 0 IFNONNULL
// 0 IFNULL
// 1 ACONST_NULL