lean4-htt/tests/lean/run/mspecNoAssignSyntheticOpaque.lean
Sebastian Graf 4ce04776b6
fix: do not assign synthetic opaque MVars in mspec (#12184)
This PR ensures that the `mspec` tactic does not assign synthetic opaque
MVars occurring in the goal, just like the `apply` tactic.
2026-01-27 10:05:20 +00:00

17 lines
457 B
Text

import Lean
open Std.Do
set_option mvcgen.warning false
theorem set_spec : ⦃⌜True⌝⦄ set (m := StateM Nat) 42 ⦃⇓_ s => ⌜s = 42⌝⦄ := by
mvcgen
example : True := by
have : ⦃⌜True⌝⦄ set (m := StateM Nat) (?n : Nat) ⦃⇓_ s => ⌜s = 42⌝⦄ := by
-- apply set_spec -- this fails, so `mspec` below should fail, too
mintro _
fail_if_success mspec set_spec
have : ?n = 42 := by rfl
mspec set_spec
trivial