lean4-htt/tests/elab/625.lean
Kim Morrison 66bc9ae177
chore: deprecate levelZero and levelOne (#12720)
This PR deprecates `levelZero` in favor of `Level.zero` and `levelOne`
in favor of the new `Level.one`, and updates all usages throughout the
codebase. The `levelZero` alias was previously required for computed
field `data` to work, but this is no longer needed.

🤖 Prepared with Claude Code
2026-03-04 01:03:08 +00:00

18 lines
561 B
Text

import Lean
open Lean Lean.PrettyPrinter
def foo : PUnit → PUnit := id
def x : PUnit := ()
@[app_unexpander foo] def unexpandFoo : Unexpander := fun _ => `(sorry)
#eval do
let e : Expr := mkApp (mkMData {} $ mkConst `foo [Level.one]) (mkConst `x)
formatTerm (← delab e)
#eval do
let opts := ({}: MData).set `pp.universes true
-- the MData annotation should make it not a regular application,
-- so the unexpander should not be called.
let e : Expr := mkApp (mkMData opts $ mkConst `foo [Level.one]) (mkConst `x)
formatTerm (← delab e)