a856e16d2f
* captured values are stored in corresponding fields before call to super constructor * preserving the order of initializers * tests * refactoring * - test fix - workaround of IR bug * refactoring * review fix
25 lines
401 B
Kotlin
25 lines
401 B
Kotlin
abstract class WaitFor {
|
|
init {
|
|
condition()
|
|
}
|
|
|
|
abstract fun condition(): Boolean;
|
|
}
|
|
|
|
fun box(): String {
|
|
val local = ""
|
|
var result = "fail"
|
|
val s = object : WaitFor() {
|
|
|
|
override fun condition(): Boolean {
|
|
result = "OK"
|
|
return result.length == 2
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
fun main(args: Array<String>) {
|
|
println(box())
|
|
} |