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
24 lines
501 B
Text
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}"
|