Skip to content

Handle named args in pattern matching - #465

Open
Krever wants to merge 3 commits into
scalacenter:mainfrom
Krever:handle-namedargs-in-unapply
Open

Handle named args in pattern matching#465
Krever wants to merge 3 commits into
scalacenter:mainfrom
Krever:handle-namedargs-in-unapply

Conversation

@Krever

@Krever Krever commented Mar 23, 2026

Copy link
Copy Markdown

Hey 👋 I spotted the bug in one of my projects and asked Claude to fix it.

Disclaimer: I have zero clue about the bigger picture here, let me know if there is more that should be considered in fixing this. (The test I added fails without the fix)

@Krever

Krever commented Jul 9, 2026

Copy link
Copy Markdown
Author

Hey @sjrd, could you take a look maybe?

// Named extractor patterns (e.g., `case Foo(field = value)`) wrap sub-patterns in NAMEDARG; discard the name
reader.readByte()
readUnsignedName()
readPattern

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This entirely discards the name. That does not seem right. If the info is in TASTy, we should surface it in the tasty-query tree.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch, I added the tree node to carry the name. Is that what you meant?

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