fix: bug at addDependencies

closes #1247
This commit is contained in:
Leonardo de Moura 2022-06-24 06:17:15 -07:00
parent ec4200fc75
commit 1fd2b17a92
2 changed files with 8 additions and 5 deletions

View file

@ -34,13 +34,8 @@ where
else
return none
alreadyVisited (fvarId : FVarId) : StateRefT Nat (StateRefT CollectFVars.State MetaM) Bool := do
let s ← getThe CollectFVars.State
return s.visitedExpr.contains (mkFVar fvarId)
go : StateRefT Nat (StateRefT CollectFVars.State MetaM) Unit := do
let some fvarId ← getNext? | return ()
if (← alreadyVisited fvarId) then return ()
/- We don't use `getLocalDecl` because `CollectFVars.State` may contains local variables that are not in the
current local context. Recall that we use this method to process match-expressions, and each AltLHS has
each own its extra local declarations. -/

8
tests/lean/run/1247.lean Normal file
View file

@ -0,0 +1,8 @@
inductive TestResult (p : Prop) where
| success : TestResult p
abbrev DecorationsOf (p : Prop) := Prop
def check (p' : DecorationsOf p) (x : TestResult p') : Unit :=
match x with
| .success => ()