summaryrefslogtreecommitdiff
path: root/test/files/run/t9697.check
Commit message (Collapse)AuthorAgeFilesLines
* SI-4683 fix $outer accesses in class bodies extending DelayedInitLukas Rytz2016-09-281-1/+1
| | | | | | | | | Constructors rewrites references to parameter accessor methods in the constructor to references to parameters. It avoids doing so for subclasses of DelayedInit. This commit makes sure the rewrite does not happen for the $outer paramter, a case that was simply forgotten.
* SI-9697 / SD-229 Fix DelayedInit subclass capturing local valueLukas Rytz2016-09-281-0/+1
When a class captures an outer value, a field for that value is created in the class. The class also gets a constructor parameter for the captured value, the constructor will assign the field. LambdaLift re-writes accesses to the local value (Ident trees) to the field. However, if the statement accessing the local value will end up inside the constructor, the access is re-written to the constructor parameter instead. This is the case for constructor statements: class C { { println(capturedLocal) } } If C extends DelayedInit, the statement does not end up in C's constructor, but into a new synthetic method. The access to `capturedLocal` needs to be re-written to the field instead of the constructor parameter. LambdaLift takes the decision (field or constructor parameter) based on the owner chain of `currentOwner`. For the constructor statement block, the owner is a local dummy, for which `logicallyEnclosingMember` returns the constructor symbol. This commit introduces a special case in LambdaLift for local dummies of DelayedInit subclasses: instead of the constructor, we use a temporary symbol representing the synthetic method holding the initializer statements.