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.
This is a fix for an issue exposed in #1638.
Essentially, this is caused by the combination of cross references, actions and fragment rule calls. The main culprit is that we temporarily create AST nodes for fragment rule calls (which wasn't really necessary in the first place) and then use those temporary elements for the
Reference
object. As these AST nodes never get into the final AST, they don't have a document reference and result in errors during the scoping phase.This change simply removes the temporary AST element, and lets the parser assign the properties to the original AST node that called the fragment rule.
Testing this fix requires a more complicated testing setup, but hopefully the comment explains this well enough.