-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cleanup inlined positions implementation #8648
Conversation
7f2f83e
to
9888224
Compare
9888224
to
d611e3c
Compare
d611e3c
to
13f4eb7
Compare
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`.
13f4eb7
to
83e28e3
Compare
24acf8a
to
e1b34c7
Compare
There was a problem hiding this 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) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
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
.