25 lines
408 B
Kotlin
Vendored
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 = false
|
|
|
|
fun box(): Boolean {
|
|
foo.execute() {
|
|
result = true
|
|
}
|
|
|
|
return result
|
|
} |