Files
kotlin/compiler/testData/codegen/boxAgainstJava/sam/adapters/implementAdapter.kt
2016-03-02 15:47:36 +03:00

21 lines
372 B
Kotlin
Vendored

// FILE: JavaInterface.java
interface JavaInterface {
void foo(Runnable r);
}
// 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"
}