Files
kotlin-fork/compiler/testData/codegen/box/sam/kt50108_java.kt
T

24 lines
401 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: test.kt
fun interface IFoo {
fun foo(s: String)
}
val foo = IFoo {}
fun box(): String {
try {
J.callWithNull(foo)
return "J.callWithNull(foo) should throw NPE"
} catch (e: NullPointerException) {
return "OK"
}
}
// FILE: J.java
public class J {
public static void callWithNull(IFoo iFoo) {
iFoo.foo(null);
}
}