Demonstrate regression in #4949 for positions of quote-inlined code #5048
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.
Testcase moved here from #5009. Edited comment from there:
It seems to have been broken by #4949 (not by #4990, I rechecked). /cc @nicolasstucki
Reason: After #4949, calling from Test.main transparent function from the same file Test.assert2 causes no repositioning; but the output trees actually come from Macros so they must be repositioned. This was an existing bug (which affected sourcePos even earlier); to fix this without changing enclosedInlineds, one needs
a node Inlined(Macros.assertImpl(...), ...) around the quote body, in addition.
Especially if there can be both code from the transparent function and from the splice, we'd need something like
We do need two EmptyTree around x != 0 to signal it does come from the original call site. Not 100% sure what goes in the ellipses.
PostTyper can strip the call as usual, no problem.