-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweaks to ExplicitOuter and TreeTypeMap #1168
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Otherwise, LGTM for last 3 commits. |
In a New we need to decide based on the prefix of the type of object created.
When recursing in a template body, need to update the context's owner, so that `ref` can work correctly.
Two changes: 1. Replace changeOwer with changeOwnerAfter for code that moves into the $initial methods in Mixin. This is needed because otherwise subsequent transforms gets confused wrt new vs old owners. `i1131.scala` exhibits the problem. 2. Drop `transformSym` changed the owner of tenplate-local symbols to be the primary constructor. But that is done anyway with a "changeOwnerAfter" in `intoConstr`. So it is redundant and actually gets in the way with a `changeOwnerAfter` in `Mixin`. The faulty scenario is this: 1. The SymTransformer of Constructor is run on a constructor-local definition. The owner of that definition is set to <init> after phase Constructors. 2. The body of the definition is transformed in Mixin. The owner is set to the initializer method, but only for the interval between Mixin and Constructors. Changing to changeOwner in Mixin avoided that problem by duplicating the symbol but it runs into other problems. Fortunately, the solution is much simpler than the status quo: Two changeOwnerAfter calls and no SymTransformer.
@DarkDimius I rebased the PR to master to better isolate its commits. Can you have a look at dad9dfc |
LGTM |
DarkDimius
added a commit
that referenced
this pull request
Mar 14, 2016
Tweaks to ExplicitOuter and TreeTypeMap
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1131.
The test shows interesting behavior where we have to copy local classes using a TreeTypeMap. Since
this happens after erasure (in phase Mixin), we need at the same time be prepared to issue explicit outer paths. There were two problems encountered with this, which are fixed in this PR.