lean4-htt/tests/lean/run/4406.lean
Kyle Miller 3f2cf8bf27
fix: set default value of pp.instantiateMVars to true and make the option be effective (#4558)
Before, `pp.instantiateMVars` generally had no effect because most call
sites for the pretty printer instantiated metavariables first, but now
this functionality is entrusted upon the `pp.instantiateMVars` option.

This also has an effect in hovers, where metavariables can be unfolded
one assignment at a time. However, the goal state still sees all
metavariables instantiated due to the fact that the algorithm relies on
expression equality post-instantiation (see
`Lean.Widget.goalToInteractive`).

Closes #4406
2024-07-02 22:59:44 +00:00

24 lines
501 B
Text

import Lean.Elab.Command
/-!
# Issue 4406: make sure `pp.instantiateMVars` has an effect
-/
open Lean Meta
set_option pp.mvars false
/-- info: ?_ -/
#guard_msgs in
set_option pp.instantiateMVars false in
run_meta do
let mvarId ← mkFreshExprMVar (.some (.const ``Nat []))
mvarId.mvarId!.assign (mkNatLit 0)
logInfo m!"{mvarId}"
/-- info: 0 -/
#guard_msgs in
run_meta do
let mvarId ← mkFreshExprMVar (.some (.const ``Nat []))
mvarId.mvarId!.assign (mkNatLit 0)
logInfo m!"{mvarId}"