401f0ac583
"// TARGET_BACKEND: JVM" more clearly says that the test is JVM-specific, rather than DONT_TARGET_EXACT_BACKEND which excludes all other backends.
26 lines
477 B
Kotlin
Vendored
26 lines
477 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
// WITH_RUNTIME
|
|
// MODULE: lib
|
|
// FILE: JavaInterface.java
|
|
|
|
interface JavaInterface {
|
|
void foo(Runnable r);
|
|
}
|
|
|
|
// MODULE: main(lib)
|
|
// FILE: 1.kt
|
|
|
|
class Impl: JavaInterface {
|
|
override fun foo(r: Runnable?) {
|
|
r?.run()
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val fooMethods = Impl::class.java.getMethods().filter { it.getName() == "foo" }
|
|
if (fooMethods.size != 1) return fooMethods.toString()
|
|
|
|
return "OK"
|
|
}
|