JS: fix unit materialization in case of null check and elvis operator
See KT-20287
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1027
|
||||
var log = ""
|
||||
|
||||
fun box(): String {
|
||||
foo() ?: bar()
|
||||
if (foo() == null) bar()
|
||||
|
||||
if (log != "foo;foo;") return "fail: $log"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
log += "foo;"
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
log += "bar;"
|
||||
}
|
||||
Reference in New Issue
Block a user