Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: tactics in terms in tactics may break incremental reporting (#4436)
A pending tactic mvar managed to escape into an unexpected context in specific circumstances. ```lean example : True := by · rw [show 0 = 0 by rfl] ``` * Term elaboration of the `show` creates a pending mvar for the `by rfl` proof * `rw` fails with an exception because the pattern does not occur in the target * `cdot` catches the exception and admits the goal * `Term.runTactic` [synthesizes all pending mvars from the tactic's execution](https://github.com/leanprover/lean4/blob/5f9dedfe5ee9972acdebd669f228f487844a6156/src/Lean/Elab/SyntheticMVars.lean#L350), including the `by rfl` proof. But this would not have happened without `cdot` as the exception would have skipped that invocation! * Now incrementality is confused because the nested `by rfl` proof is unexpectedly run in the same context as the top-level proof, writing to the wrong promise, and the error message is lost Solution: disable incrementality for these pending mvars
- Loading branch information