mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
19 lines
301 B
Kotlin
Vendored
19 lines
301 B
Kotlin
Vendored
var log = ""
|
|
|
|
open class Base(val s: String)
|
|
|
|
class A(i: Int) : Base("O" + if (i == 23) {
|
|
log += "logged"
|
|
"K"
|
|
}
|
|
else {
|
|
"fail"
|
|
})
|
|
|
|
fun box(): String {
|
|
val result = A(23).s
|
|
if (result != "OK") return "fail: $result"
|
|
if (log != "logged") return "fail log: $log"
|
|
|
|
return "OK"
|
|
} |