Handle nested when with subject properly

Hack: callee expression for when with subject variable is the subject
variable declaration. This solves the problem that all sub-calls in the
expression are implicitly considered to have a single common lexical
scope (and 'when (val x = ...)' introduces a new lexical scope, which
contains 'x').
This commit is contained in:
Dmitry Petrov
2018-06-08 11:25:17 +03:00
parent 758548603e
commit ae929d0f08
7 changed files with 88 additions and 20 deletions
@@ -0,0 +1,8 @@
package
public fun </*0*/ T> bar(/*0*/ x: T, /*1*/ y: T): kotlin.Unit
public fun foo(): kotlin.Unit
public fun test1(): kotlin.Unit
public fun test2(): kotlin.Unit
public fun test3(): kotlin.Unit
public fun test4(): kotlin.Unit