401f0ac583
"// TARGET_BACKEND: JVM" more clearly says that the test is JVM-specific, rather than DONT_TARGET_EXACT_BACKEND which excludes all other backends.
27 lines
469 B
Kotlin
Vendored
27 lines
469 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// MODULE: lib
|
|
// FILE: JavaClass.java
|
|
|
|
class JavaClass {
|
|
private Runnable r;
|
|
|
|
public JavaClass(Runnable r) {
|
|
this.r = r;
|
|
}
|
|
|
|
public void run() {
|
|
r.run();
|
|
}
|
|
}
|
|
|
|
// MODULE: main(lib)
|
|
// FILE: 1.kt
|
|
|
|
var status: String = "fail" // global property to avoid issues with accessing closure from local class (KT-4174)
|
|
|
|
fun box(): String {
|
|
class C() : JavaClass({status = "OK"}) {}
|
|
C().run()
|
|
return status
|
|
}
|