Skip to content

ScalametaParser: fix handling of $x and 'x#4438

Merged
kitbellew merged 1 commit intoscalameta:mainfrom
kitbellew:4438
Jan 24, 2026
Merged

ScalametaParser: fix handling of $x and 'x#4438
kitbellew merged 1 commit intoscalameta:mainfrom
kitbellew:4438

Conversation

@kitbellew
Copy link
Copy Markdown
Collaborator

  • $x is a splice only within a macro quote; otherwise, an identifier
  • 'x is always a quote, regardless whether it's within a macro quote or a macro splice; in scala3, quotes don't introduce symbols anymore.

@kitbellew kitbellew requested a review from tgodzik January 24, 2026 16:18
tgodzik
tgodzik previously approved these changes Jan 24, 2026
- `$x` is a splice only within a macro quote; otherwise, an identifier
- `'x` is always a quote, regardless whether it's within a macro quote
  or a macro splice; in scala3, quotes don't introduce symbols anymore.
- pass Symbol to MacroQuotedIdent; that way, the compiler immediately
  detects that this unapply is used after a previous match on Literal
  and complains about unreachable code.
@kitbellew kitbellew merged commit 7288004 into scalameta:main Jan 24, 2026
19 checks passed
@kitbellew kitbellew deleted the 4438 branch January 24, 2026 21:00
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.

2 participants