JS: fix unit materialization in case of null check and elvis operator

See KT-20287
This commit is contained in:
Alexey Andreev
2017-09-18 12:35:50 +03:00
parent b4c622d433
commit c5e5a43f68
4 changed files with 32 additions and 3 deletions
+18
View File
@@ -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;"
}