Support 'when' with subject variable in psi2ir
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// !LANGUAGE: +VariableDeclarationInWhenSubject
|
||||
|
||||
fun foo(): Any = 1
|
||||
|
||||
fun test() =
|
||||
when (val y = foo()) {
|
||||
42 -> 1
|
||||
is String -> y.length
|
||||
!is Int -> 2
|
||||
in 0..10 -> 3
|
||||
!in 10..20 -> 4
|
||||
else -> -1
|
||||
}
|
||||
Reference in New Issue
Block a user