Skip to content

Add \exhaustive\ annotation to exhaustive match blocks#131

Merged
SeanTAllen merged 1 commit intomainfrom
sean/add-exhaustive-match-annotation
Mar 1, 2026
Merged

Add \exhaustive\ annotation to exhaustive match blocks#131
SeanTAllen merged 1 commit intomainfrom
sean/add-exhaustive-match-annotation

Conversation

@SeanTAllen
Copy link
Member

Ponyc recently added an \exhaustive\ annotation for match expressions. When present, the compiler will fail compilation if the match is not exhaustive. This protects against future breakage if new variants are added to a union type.

This adds \exhaustive\ to all match blocks that are currently exhaustive and do not have an else clause.

Ponyc recently added an \exhaustive\ annotation for match expressions.
When present, the compiler will fail compilation if the match is not
exhaustive. This protects against future breakage if new variants are
added to a union type.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Mar 1, 2026
@SeanTAllen SeanTAllen merged commit c4e5935 into main Mar 1, 2026
10 checks passed
@SeanTAllen SeanTAllen deleted the sean/add-exhaustive-match-annotation branch March 1, 2026 16:13
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Mar 1, 2026
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