Skip to content

Error when class patterns are used as enums in pattern match #2153

@yangdanny97

Description

@yangdanny97

Describe the Bug

For example, error when case Color.RED(): is used, it should be case Color.RED:

This was originally implemented as part of #1833 but we didn't merge that change since it felt separate from the core change in the PR.

We would be open to accepting a PR that implements this change separately.

The error should be something like invalid-pattern

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedLarger than "good first issue", but still well-defined and ready for someone to pick uptypechecking

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions