Skip to content

Add \exhaustive\ annotation to exhaustive match blocks#54

Merged
SeanTAllen merged 2 commits into
mainfrom
sean/add-exhaustive-match-annotation
Mar 1, 2026
Merged

Add \exhaustive\ annotation to exhaustive match blocks#54
SeanTAllen merged 2 commits into
mainfrom
sean/add-exhaustive-match-annotation

Conversation

@SeanTAllen

Copy link
Copy Markdown
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
The annotation script incorrectly replaced "match" inside multi-line
docstrings. This restores the original prose text.
@SeanTAllen
SeanTAllen merged commit 8f8f6bd into main Mar 1, 2026
7 checks passed
@SeanTAllen
SeanTAllen deleted the sean/add-exhaustive-match-annotation branch March 1, 2026 16:12
@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