Skip to content

Fix issue with macro results having unexpected source switches in TASTy #23397

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Jun 20, 2025

Problem seems to have been derived from the fact that we would only remap the source of the outermost tree inserted in a Hole, instead of going through the whole tree inserted there. This meant that when inserting Block with Imports in the contents, the Block node would have a new source assigned (causing a source change encoded in the TASTy), and all contents would still have the previous source assigned (causing more source changes encoded).

Now we reassign sources to nodes recursively, meaning that only the outermost node has a source change assigned in TASTy.
Fixes #22265

Problem seems to have been derived from the fact that we would only
remap the source of the outermost tree inserted in a Hole, instead of
going through the whole tree inserted there. This meant that when
inserting `Block` with `Imports` in the contents, the Block node would
have a new source assigned (causing a source change encoded in the
TASTy), and all contents would still have the previous source assigned
(causing more source changes encoded).

Now we reassign sources to nodes recursively, meaning that only
the outermost node has a source change assigned in TASTy.
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.

Scala doc crashes with AssertionError on macro generated code
1 participant