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

Fix invalid pattern: quasiquote handling of Apply #3580

Merged
merged 1 commit into from Feb 23, 2024

Conversation

kitbellew
Copy link
Contributor

@kitbellew kitbellew commented Feb 22, 2024

The new version of scala 2.13 has finally discovered these issues, so let's fix them before adding support for that version.

In this particular case, there was an invalid pattern that wouldn't have matched anything as written, but even if we consider the intent of this pattern, it likely came before changes in scalameta parser which re-interpreted a foo(...$bar) tree.

That is, this code, which would have been parsed originally as Apply(foo, ArgClause(List(Term.Quasi(rank=2)))), would now become, through special Syntactic.TermApply.ArgList, Apply(foo, ArgClause.Quasi(rank=1)).

Hence, the List(...) would always give way to lower-rank quasi of an ArgClause, hence this pattern is no longer necessary.

Fixes #3576.

The new version of scala 2.13 has finally discovered these issues, so
let's fix them before adding support for that version.

In this particular case, there was an invalid pattern that wouldn't
have matched anything as written, but even if we consider the intent of
this pattern, it likely came before changes in scalameta parser which
re-interpreted a `foo(...$bar)` tree.

That is, this code, which would have been parsed originally as
`Apply(foo, ArgClause(List(Term.Quasi(rank=2))))`,
would now become, through special `Syntactic.TermApply.ArgList`,
`Apply(foo, ArgClause.Quasi(rank=1))`.

Hence, the `List(...)` would always give way to lower-rank quasi of an
`ArgClause`, hence this pattern is no longer necessary.
Copy link
Collaborator

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@tgodzik tgodzik merged commit 47b6e51 into scalameta:main Feb 23, 2024
24 checks passed
@kitbellew kitbellew deleted the 3580 branch February 23, 2024 08:01
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 2.13.13 causes fruitless type test warning in macros
3 participants