Fix the source of inlined trees after Erasure#5883
Merged
odersky merged 3 commits intoscala:masterfrom Feb 14, 2019
Merged
Conversation
e6a7ce8 to
036ab3b
Compare
To ensure that the sources change, the trees need to be copied with the new source rather than preserving it.
4eb58a7 to
1300311
Compare
odersky
reviewed
Feb 11, 2019
Contributor
odersky
left a comment
There was a problem hiding this comment.
I wonder whether there's not a less intrusive way to do it:
- In
Reposition, copy all leaf trees manually, usinguntpdconstructor methods instead ofcpy. - Then use the tree copier for the rest. That still needs
sourceFile, but we don't need to test for
sameSourceanymore.
665afb3 to
0984428
Compare
0984428 to
983eb87
Compare
odersky
approved these changes
Feb 14, 2019
liufengyun
reviewed
Feb 14, 2019
| case _ => finalize(tree, untpd.RefinedTypeTree(tpt, refinements)(sourceFile(tree))) | ||
| } | ||
| def AppliedTypeTree(tree: Tree)(tpt: Tree, args: List[Tree])(implicit ctx: Context): AppliedTypeTree = tree match { | ||
| case tree: AppliedTypeTree if (tpt eq tree.tpt) && (args eq tree.args) => tree |
Contributor
There was a problem hiding this comment.
I remember from #5892 there used to be a check sameSourceFile in the case, why it is not needed anymore?
This file contains hidden or 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
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.
To ensure that the sources change, the trees need to be copied with the
new source rather than preserving it.