Files
kotlin-fork/js/js.translator/testData/box/coercion/unitNullCheck.kt
T
2018-10-09 15:33:04 +03:00

27 lines
466 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1282
var log = ""
fun log(msg: String) {
log += "$msg;"
}
fun box(): String {
log("!!")!!
log("elvis-left") ?: log("elvis-right")
if (log("if") == null) log("then")
when (null) {
log("when-pattern") -> log("when-body-1")
}
when (log("when-subject")) {
null -> log("when-body-2")
}
if (log != "!!;elvis-left;if;when-pattern;when-subject;") return "fail: $log"
return "OK"
}