[Test] Properly merge box against java testdata into codegen/box
Previous commit about it was 3199ce03 and it was completely wrong
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// DONT_TARGET_EXACT_BACKEND: JS JS_IR JS_IR_ES6 WASM NATIVE
|
||||
// KOTLIN_CONFIGURATION_FLAGS: +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"
|
||||
}
|
||||
Reference in New Issue
Block a user