Skip to content

Cleanup inlined positions implementation #8648

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

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Apr 1, 2020

Trees now have sources that can be used directly without the need of enclosingInlineds
to track the current source. This new implemetation simply uses the tree positions
directly and does not need to keep the context in sync with the enclosingInlineds.

@nicolasstucki nicolasstucki self-assigned this Apr 1, 2020
@nicolasstucki nicolasstucki force-pushed the clenup-inlined-positions-implememtations branch from 7f2f83e to 9888224 Compare April 1, 2020 17:27
@nicolasstucki nicolasstucki changed the title Clenup inlined positions implememtations Cleanup inlined positions implementation Apr 1, 2020
@nicolasstucki nicolasstucki force-pushed the clenup-inlined-positions-implememtations branch from 9888224 to d611e3c Compare April 1, 2020 19:00
@nicolasstucki nicolasstucki force-pushed the clenup-inlined-positions-implememtations branch from d611e3c to 13f4eb7 Compare April 1, 2020 19:05
Trees now have sources that can be used directly without the need of `enclosingInlineds`
to track the current source. This new implemetation simply uses the tree positions
directly and does not need to keep the context in sync with the `enclosingInlineds`.
@nicolasstucki nicolasstucki force-pushed the clenup-inlined-positions-implememtations branch from 13f4eb7 to 83e28e3 Compare April 1, 2020 20:36
@nicolasstucki nicolasstucki marked this pull request as ready for review April 1, 2020 21:53
@nicolasstucki nicolasstucki requested a review from liufengyun April 1, 2020 21:53
@nicolasstucki nicolasstucki force-pushed the clenup-inlined-positions-implememtations branch from 24acf8a to e1b34c7 Compare April 2, 2020 06:24
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

case tree: Bind => finalize(tree, untpd.Bind(tree.name, transform(tree.body))(curSource))
def finalize(copied: untpd.Tree) =
val span = if tree.source == curSource then tree.span else callSpan
copied.withSpan(span).withAttachmentsFrom(tree).withTypeUnchecked(tree.tpe)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to change the tree.source?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is done by the cpyWithNewSource. This logic did not change.

@nicolasstucki nicolasstucki merged commit a0690e1 into scala:master Apr 2, 2020
@nicolasstucki nicolasstucki deleted the clenup-inlined-positions-implememtations branch April 2, 2020 15:29
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.

2 participants