This commit is contained in:
Leonardo de Moura 2022-05-26 07:05:32 -07:00
parent 1d14637680
commit 988697b431
2 changed files with 9 additions and 0 deletions

View file

@ -193,6 +193,8 @@ where
else
match (← matchEq? localDecl.type) with
| some (α, lhs, rhs) =>
let lhs ← instantiateMVars lhs
let rhs ← instantiateMVars rhs
if rhs.isFVar && rhs.fvarId! == h && !mctx.exprDependsOn lhs h then
return some (localDecl.fvarId, true)
else if lhs.isFVar && lhs.fvarId! == h && !mctx.exprDependsOn rhs h then

7
tests/lean/run/1169.lean Normal file
View file

@ -0,0 +1,7 @@
inductive Foo (n: Nat)
| mk: n = 0 → Foo n
example (h: Foo x): x + 1 = 1 := by
cases h
subst x
rfl