lean4-htt/tests/lean/run/3091.lean
Eric Wieser f22998edfe
fix: collect level parameters in evalExpr (#3090)
`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
2024-09-27 11:55:33 +02:00

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])