fix: no sorry-warning for missing match cases

This commit is contained in:
Gabriel Ebner 2022-06-01 15:54:00 +02:00 committed by Leonardo de Moura
parent bf0b675ca6
commit 9a273b85a3
6 changed files with 1 additions and 6 deletions

View file

@ -1112,9 +1112,9 @@ private def elabMatchAux (generalizing? : Option Bool) (discrStxs : Array Syntax
let numDiscrs := discrs.size
let matcherName ← mkAuxName `match
let matcherResult ← mkMatcher { matcherName, matchType, discrInfos := discrs.map fun discr => { hName? := discr.h?.map (·.getId) }, lhss := altLHSS }
reportMatcherResultErrors altLHSS matcherResult
matcherResult.addMatcher
let motive ← forallBoundedTelescope matchType numDiscrs fun xs matchType => mkLambdaFVars xs matchType
reportMatcherResultErrors altLHSS matcherResult
let r := mkApp matcherResult.matcher motive
let r := mkAppN r (discrs.map (·.expr))
let r := mkAppN r rhss

View file

@ -1,4 +1,3 @@
301.lean:1:9-1:17: warning: declaration uses 'sorry'
301.lean:1:9-1:17: error: missing cases:
(Nat.succ _)
301.lean:1:21-1:24: error: type mismatch

View file

@ -1,3 +1,2 @@
matchErrorMsg.lean:2:1-4:16: warning: declaration uses 'sorry'
matchErrorMsg.lean:2:1-2:6: error: missing cases:
(Prod.mk Nat.zero (Nat.succ _))

View file

@ -1,3 +1,2 @@
matchMissingCasesAsStuckError.lean:2:2-3:24: warning: declaration uses 'sorry'
matchMissingCasesAsStuckError.lean:2:2-2:7: error: missing cases:
none

View file

@ -1,4 +1,3 @@
matchUnknownFVarBug.lean:2:2-3:19: warning: declaration uses 'sorry'
matchUnknownFVarBug.lean:2:2-2:7: error: missing cases:
(some (Nat.succ _)), (some _)
(some (Nat.succ _)), none

View file

@ -1,4 +1,3 @@
patvar.lean:3:0-3:22: warning: declaration uses 'sorry'
patvar.lean:3:0-3:22: error: missing cases:
(List.cons _ _)
patvar.lean:10:0-10:16: error: missing cases: