-
-
Notifications
You must be signed in to change notification settings - Fork 4
Implement match expression for pattern matching #164
Copy link
Copy link
Open
Labels
discussionIssues that require a technical or community discussion.Issues that require a technical or community discussion.enhancementA request for a new feature or improvement.A request for a new feature or improvement.feature requestA request for a new feature or functionality.A request for a new feature or functionality.
Metadata
Metadata
Assignees
Labels
discussionIssues that require a technical or community discussion.Issues that require a technical or community discussion.enhancementA request for a new feature or improvement.A request for a new feature or improvement.feature requestA request for a new feature or functionality.A request for a new feature or functionality.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Backlog
Background:
Wave currently supports
if,while, and function calls, but lacks a native pattern matching construct.Adding a
matchexpression would allow more expressive and readable control flow, especially for handling enums, constant values, and futureOption-like types.Expected Behavior:
A
matchexpression should support matching against values with multiple arms, including a default case.For example:
Each arm should end with an expression or block.
A wildcard (
_) must be supported as a fallback/default case.Future support should allow nested
match, enum matching, and more.User Scenarios:
if-elsechains with cleaner, declarative syntax.Option,Result) require pattern-based branching.Additional Information:
Language version: - (not yet assigned)
Target branch:
developParser and compiler will need updates to support match as an expression
Could later expand to support destructuring and pattern guards