This PR modifies `#eval e` to elaborate `e` with section variables in scope. While evaluating expressions with free variables is not possible, this lets `#eval` give a better error message than "unknown identifier." Example: ```lean section variable (n : Nat) /-- error: Cannot evaluate, contains free variable `n` -/ #guard_msgs in #eval n end ``` The error is localized to `#eval`. It would be more friendly if the error were to be placed on uses of free variables. [Zulip discussion](https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/Unknown.20identifier.20error.20messages.20for.20.60.23eval.60/near/560864544)
2 lines
128 B
Text
2 lines
128 B
Text
metaEvalInstMessage.lean:5:0-5:5: error: Could not synthesize a `ToExpr`, `Repr`, or `ToString` instance for type
|
|
Nat → Nat
|