Introduce separate callee expression for when with subject variable

'Subject.Error' is redundant.
'Subject.None' can be an object.
'Subject#dataFlowValue' can be a lateinit property.

TODO: fix
- parsing local extension properties in 'when' subject
- parsing destructuring declarations in 'when' subject
- non-completed calls in nested 'when' with subject variable
- non-completed calls for subject variable in 'in' pattern
This commit is contained in:
Dmitry Petrov
2017-10-23 13:42:27 +03:00
parent a76bf57694
commit 091b935c2d
10 changed files with 90 additions and 77 deletions
@@ -0,0 +1,8 @@
// !LANGUAGE: +VariableDeclarationInWhenSubject
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
fun test(x: Any) {
when (val y = x) {
is String -> {}
}
}