[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,36 @@
|
||||
// DONT_TARGET_EXACT_BACKEND: JS JS_IR JS_IR_ES6 WASM NATIVE
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: Delegation.java
|
||||
|
||||
public class Delegation {
|
||||
public static class ReturnNull {
|
||||
public String foo() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: delegation.kt
|
||||
|
||||
interface Tr {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
class DelegateTo : Delegation.ReturnNull(), Tr {
|
||||
override fun foo() = super<Delegation.ReturnNull>.foo()
|
||||
}
|
||||
|
||||
class DelegateFrom : Tr by DelegateTo()
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
DelegateFrom().foo()
|
||||
return "Fail: should have been an exception"
|
||||
}
|
||||
catch(e: NullPointerException) {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user