`elabEvalUnsafe` already does something similar: it also instantiates universe metavariables, but it is not clear to me whether that is sensible here. To be conservative, I leave it out of this PR. See https://github.com/leanprover/lean4/pull/3090#discussion_r1432007590 for a comparison between `#eval` and `Meta.evalExpr`. This PR is not trying to fully align them, but just to fix one particular misalignment that I am impacted by. Closes #3091
13 lines
237 B
Text
13 lines
237 B
Text
import Lean
|
|
|
|
open Lean
|
|
|
|
def foo.{u} : Nat := (ULift.up.{u} Nat.zero).down
|
|
|
|
universe u in
|
|
#eval foo.{u}
|
|
|
|
-- this used to produce an error
|
|
#eval do
|
|
let u : Lean.Level := .param `u
|
|
Meta.evalExpr Nat (.const ``Nat []) (.const ``foo [u])
|