Skip to content

Commit

Permalink
fix: revert creates natural metavariable goal (#6145)
Browse files Browse the repository at this point in the history
This PR fixes the `revert` tactic so that it creates a `syntheticOpaque`
metavariable as the new goal, instead of a `natural` metavariable

I reported it on
[Zulip](https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/.60revert.60.20gives.20natural.20metavariable.20goal/near/483388096)
  • Loading branch information
JovanGerb authored Nov 21, 2024
1 parent 7f2e7e5 commit b7248d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Lean/Meta/Tactic/Revert.lean
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def _root_.Lean.MVarId.revert (mvarId : MVarId) (fvarIds : Array FVarId) (preser
finally
mvarId.setKind .syntheticOpaque
let mvar := e.getAppFn
mvar.mvarId!.setKind .syntheticOpaque
mvar.mvarId!.setTag tag
return (toRevert.map Expr.fvarId!, mvar.mvarId!)

Expand Down
10 changes: 10 additions & 0 deletions tests/lean/run/revertMetavarKind.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Lean.Meta

open Lean Elab Tactic

example (n : Nat) : n = n := by
revert n
run_tac do
guard (← getMainDecl).kind.isSyntheticOpaque
intro n
rfl

0 comments on commit b7248d5

Please sign in to comment.