mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
24 lines
426 B
Kotlin
Vendored
24 lines
426 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 runnable(): (() -> Unit)? = null
|
|
|
|
fun test() {
|
|
JFoo.foo2({}, runnable())
|
|
}
|
|
|
|
// @TestKt.class:
|
|
// 2 NEW
|
|
// 0 IFNONNULL
|
|
// 1 IFNULL
|
|
// 1 ACONST_NULL |