refactor: processLeaf: Only look at first alt (#10774)
This PR lets match compilation look only at the first remaining alternative in `processLeaf`. At this point we have no further variables we can split on, so if the first one isn’t applicable, match compilation should fail.
This commit is contained in:
parent
45df6fcd37
commit
ed4d453346
1 changed files with 2 additions and 2 deletions
|
|
@ -328,9 +328,9 @@ where
|
|||
trace[Meta.Match.match] "missing alternative"
|
||||
p.mvarId.admit
|
||||
modify fun s => { s with counterExamples := p.examples :: s.counterExamples }
|
||||
| alt :: alts =>
|
||||
| alt :: _ =>
|
||||
unless (← solveCnstrs p.mvarId alt) do
|
||||
go alts
|
||||
throwErrorAt alt.ref "Dependent match elimination failed: Could not solve constraints"
|
||||
|
||||
private def processAsPattern (p : Problem) : MetaM Problem := withGoalOf p do
|
||||
let x :: _ := p.vars | unreachable!
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue