Repository navigation
Settle pattern types against ana, so pattern errors are marked once - #2866
Open
Negabinary wants to merge 1 commit into
Open
Negabinary wants to merge 1 commit into
Negabinary wants to merge 1 commit into
Conversation
A pattern's ty is the type of the value it matches: its rule's type, built from its children's ty, refined by ana, or ana where they disagree. That is what parents build from now, so a mismatch is marked where it arises and goes no further up: parentheses, projectors, tuples and lists of patterns no longer repeat it. A pattern's elab syn type was what it demands on its own, the same as its syn type, so it is dropped. No ascription is inserted: the elaboration already records ty (a function's parameter type). A mismatch is kept beside other marks, as for expressions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 25, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## settle-elab-syn-ty #2866 +/- ##
======================================================
+ Coverage 48.51% 48.53% +0.01%
======================================================
Files 499 499
Lines 57723 57730 +7
======================================================
+ Hits 28005 28017 +12
+ Misses 29718 29713 -5
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2849. Followed by #2867.
A pattern's error is now marked once, as an expression's is in #2849.
The types
Each pattern has three types:
ana: what its parent expects.syn_ty: what the pattern demands on its own, built from its parts'syn_ty: a literal's type, an annotation,?for a variable. Only the inspector reads it.ty: the type of the value it matches. This is its rule's type, built from its children'sty, met withana, oranawhere the two are inconsistent (marked there). Parents build from it, and the elaboration records it as, for example, a function's parameter type.Unlike an expression's
elab_syn_ty,tytakes in whatanasays even where the two agree, because a variable's type comes fromanaalone. The patternelab_syn_tyheld the same type assyn_ty, so it is gone. No ascription is inserted, since the elaboration already recordsty.Examples (#2849 on top)
Not done
A tuple pattern with an unexpected label still marks the label, its entry and the tuple. #2849's treatment for expressions would apply here the same way.
Testing
make test-quick: 4577 tests, including new pattern cases inStatics.Settling.🤖 Generated with Claude Code