Files
kotlin-fork/compiler/testData/codegen/box/notNullAssertions/doGenerateParamAssertions.kt
T
Alexander Udalov 401f0ac583 Use TARGET_BACKEND instead of DONT_TARGET_EXACT_BACKEND in box against Java tests
"// TARGET_BACKEND: JVM" more clearly says that the test is
JVM-specific, rather than DONT_TARGET_EXACT_BACKEND which excludes all
other backends.
2021-02-11 13:50:08 +01:00

40 lines
744 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// DISABLE_CALL_ASSERTIONS
// MODULE: lib
// FILE: C.java
package test;
import org.jetbrains.annotations.NotNull;
public abstract class C<Type> {
public abstract void doTest(@NotNull Type s);
public static void runTest(C a) {
try {
a.doTest(null);
} catch (NullPointerException e) {
return;
}
throw new AssertionError("Fail: NullPointerException expected");
}
}
// MODULE: main(lib)
// FILE: B.kt
import test.C
class TestString : C<String>() {
override fun doTest(s: String) { }
}
class TestUnit : C<Unit>() {
override fun doTest(s: Unit) { }
}
fun box(): String {
C.runTest(TestString())
C.runTest(TestUnit())
return "OK"
}