Support 'when' with subject variable in JVM BE

This commit is contained in:
Dmitry Petrov
2018-06-08 12:51:33 +03:00
parent 148d03e365
commit d6894091a9
9 changed files with 225 additions and 24 deletions
@@ -0,0 +1,10 @@
// !LANGUAGE: +VariableDeclarationInWhenSubject
// IGNORE_BACKEND: JS
val x = 1
fun box() =
when (val y = x) {
1 -> "OK"
else -> "Fail: $y"
}