Skip to content
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

Keep tree of type ascriptions of quote pattern splices #18412

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

nicolasstucki
Copy link
Contributor

These trees where removed as part of an optimization. However, they should be kept around to allow for better error messages and IDE navigation.

The type of the ascription in pickled in the TASTy file but is elided in the pickled quote pattern (same optimization already done later).

Fixes #18409

@nicolasstucki nicolasstucki force-pushed the fix-18409 branch 3 times, most recently from 990faff to c34c741 Compare August 16, 2023 15:46
These trees where removed as part of an optimization. However, they
should be kept around to allow for better error messages and IDE navigation.

The type of the ascription in pickled in the TASTy file but is elided in
the pickled quote pattern (same optimization already done later).

Fixes scala#18409
@nicolasstucki nicolasstucki added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Aug 17, 2023
super.transform(tree)
case tree: SplicePattern =>
if !ctx.reporter.errorsReported then
Checking.checkAppliedTypesIn(TypeTree(tree.tpe).withSpan(tree.span))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a workaround that we added to check the types of the splices because we removed them in QuotesAndSplices. Now those types are checked directly on their ASTs.

Copy link
Contributor

@jchyb jchyb left a comment

Choose a reason for hiding this comment

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

LGTM!

@nicolasstucki nicolasstucki marked this pull request as ready for review August 17, 2023 11:24
@nicolasstucki nicolasstucki merged commit 38350ec into scala:main Aug 17, 2023
17 checks passed
@nicolasstucki nicolasstucki deleted the fix-18409 branch August 17, 2023 11:24
@Kordyjan Kordyjan removed the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Oct 10, 2023
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
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.

Regression in arainko/ducktape: -Wunused:all false-positive in quotes
3 participants