Files
kotlin-fork/compiler/testData/codegen/box/invokedynamic/sam/nullabilityAssertions.kt
T
Dmitry Petrov 5013344bc4 JVM_IR nullability assertions test for indy lambdas
KT-44278 KT-26060 KT-42621
2021-02-12 16:52:32 +03:00

25 lines
435 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
// FILE: nullabilityAssertions.kt
fun box(): String {
try {
A.bar {}
} catch (e: NullPointerException) {
return "OK"
}
return "Should throw NullPointerException"
}
// FILE: A.java
import org.jetbrains.annotations.NotNull;
public interface A {
void foo(@NotNull String s);
static void bar(A a) {
a.foo(null);
}
}