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