Files
kotlin/compiler/testData/codegen/boxAgainstJava/sam/adapters/inheritedSimple.kt
2018-08-02 13:19:27 +02:00

22 lines
309 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// FILE: Sub.java
class Super {
void safeInvoke(Runnable r) {
if (r != null) r.run();
}
}
class Sub extends Super {
}
// FILE: 1.kt
fun box(): String {
var r = "FAIL"
val sub = Sub()
sub.safeInvoke(null)
sub.safeInvoke { r = "OK" }
return r
}