Files
kotlin-fork/js/js.translator/testData/box/objectDeclaration/objectInheritingFromATrait.kt
T
2016-09-29 12:00:42 +03:00

25 lines
408 B
Kotlin
Vendored

package foo
interface Foo {
fun execute(handler: () -> Unit) {
execute(false, handler)
}
fun execute(onlyIfAttached: Boolean, handler: () -> Unit)
}
object foo : Foo {
override fun execute(onlyIfAttached: Boolean, handler: () -> Unit) {
handler()
}
}
private var result = "fail"
fun box(): String {
foo.execute() {
result = "OK"
}
return result
}