Files
kotlin/compiler/testData/codegen/boxAgainstJava/notNullAssertions/doGenerateParamAssertions.kt
Mikhail Zarechenskiy 5c5635ce20 Fix codegen & bytecode tests after unifying exceptions in JVM backend
See KT-22275 for details
2020-01-20 16:36:03 +03:00

37 lines
718 B
Kotlin
Vendored

// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_CALL_ASSERTIONS
// 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");
}
}
// 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"
}