fix: disable auto implicit feature when running tactics

fixes #1569
This commit is contained in:
Leonardo de Moura 2022-09-09 15:17:50 -07:00
parent 9f134cad8e
commit 353eb0dd27
3 changed files with 4 additions and 1 deletions

View file

@ -325,7 +325,7 @@ mutual
/--
Try to synthesize a term `val` using the tactic code `tacticCode`, and then assign `mvarId := val`.
-/
partial def runTactic (mvarId : MVarId) (tacticCode : Syntax) : TermElabM Unit := do
partial def runTactic (mvarId : MVarId) (tacticCode : Syntax) : TermElabM Unit := withoutAutoBoundImplicit do
/- Recall, `tacticCode` is the whole `by ...` expression. -/
let code := tacticCode[1]
instantiateMVarDeclMVars mvarId

2
tests/lean/1569.lean Normal file
View file

@ -0,0 +1,2 @@
def foo (x : Nat) (_ : x = 0) : Nat := x
example : foo 0 (by simp [typo]; done) = 0 := sorry

View file

@ -0,0 +1 @@
1569.lean:2:26-2:30: error: unknown identifier 'typo'