mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
32 lines
415 B
Kotlin
Vendored
32 lines
415 B
Kotlin
Vendored
// FILE: test/Foo.java
|
|
|
|
package test;
|
|
|
|
public class Foo {
|
|
protected void foo(Runnable r) {
|
|
r.run();
|
|
}
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
package other
|
|
|
|
import test.Foo
|
|
|
|
class Bar : Foo() {
|
|
fun bar() {
|
|
foo {}
|
|
foo(Runnable {})
|
|
// super.foo {}
|
|
super.foo(Runnable {})
|
|
this.foo {}
|
|
this.foo(Runnable {})
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
Bar().bar()
|
|
return "OK"
|
|
}
|