lean4-htt/tests/elab/isDefEqCheckAssignmentBug.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

26 lines
839 B
Text

import Lean
open Lean
open Lean.Meta
def f (x : Type) := x
def tst : MetaM Unit := do
let m1 ← mkFreshExprMVar none
withLocalDeclD `x m1 fun x => do
trace[Meta.debug] "{x} : {← inferType x}"
trace[Meta.debug] "{m1} : {← inferType m1}"
let m2 ← mkFreshExprMVar (mkSort Level.one)
let t ← mkAppM ``f #[m2]
trace[Meta.debug] "{m2} : {← inferType m2}"
unless (← fullApproxDefEq <| isDefEq m1 t) do -- m1 := f m3 -- where `m3` has a smaller scope than `m2`
throwError "isDefEq failed"
trace[Meta.debug] "{m2} : {← inferType m2}"
trace[Meta.debug] "{m1} : {← inferType m1}"
let e ← mkForallFVars #[x] m2 -- `forall (x : f ?m2), ?m2`
trace[Meta.debug] "{e} : {← inferType e}"
return ()
set_option trace.Meta.isDefEq true
set_option trace.Meta.debug true
#eval tst