Support 'when' with subject variable in psi2ir

This commit is contained in:
Dmitry Petrov
2018-06-08 15:31:28 +03:00
parent d6894091a9
commit bf083314dd
4 changed files with 83 additions and 6 deletions
@@ -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
}