Skip to content

Binding a pattern match variable by field name is not mentioned #3313

Description

@whowatchlist

The fact that you can use named fields for pattern matching is not mentioned in
https://docs.scala-lang.org/tour/case-classes.html
or in
https://docs.scala-lang.org/tour/pattern-matching.html

The only mention of this feature is here: https://docs.scala-lang.org/scala3/reference/other-new-features/named-tuples.html#pattern-matching-with-named-fields-in-general

This feature seems to be released with scala 3.7, so it probably just hasn't been updated for it. This feature exists in other languages like rust and haskell, so people learning scala will probably miss this and wonder why scala doesn't have that feature.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions