Skip to content

Conversation

@nicolasstucki
Copy link
Contributor

To ensure that the sources change, the trees need to be copied with the
new source rather than preserving it.

@nicolasstucki nicolasstucki self-assigned this Feb 8, 2019
@nicolasstucki nicolasstucki force-pushed the fix-source-after-erasure branch 5 times, most recently from e6a7ce8 to 036ab3b Compare February 11, 2019 12:44
To ensure that the sources change, the trees need to be copied with the
new source rather than preserving it.
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether there's not a less intrusive way to do it:

  • In Reposition, copy all leaf trees manually, using untpd constructor methods instead of cpy.
  • Then use the tree copier for the rest. That still needs sourceFile, but we don't need to test for
    sameSource anymore.

@odersky odersky assigned nicolasstucki and unassigned odersky Feb 11, 2019
@nicolasstucki nicolasstucki force-pushed the fix-source-after-erasure branch from 665afb3 to 0984428 Compare February 12, 2019 10:58
@nicolasstucki nicolasstucki force-pushed the fix-source-after-erasure branch from 0984428 to 983eb87 Compare February 12, 2019 11:02
@odersky odersky merged commit fa8471d into scala:master Feb 14, 2019
@ghost ghost removed the stat:needs review label Feb 14, 2019
@liufengyun liufengyun deleted the fix-source-after-erasure branch February 14, 2019 12:39
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember from #5892 there used to be a check sameSourceFile in the case, why it is not needed anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants