Support 'when' with subject variable in JVM BE
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// !LANGUAGE: +VariableDeclarationInWhenSubject
|
||||
// IGNORE_BACKEND: JS
|
||||
|
||||
val x: Any = 1
|
||||
|
||||
fun box() =
|
||||
when (val y = x) {
|
||||
is Int -> "OK"
|
||||
else -> "Fail: $y"
|
||||
}
|
||||
Reference in New Issue
Block a user