lean4-htt/tests/lean/run/DefEqAssignBug.lean
Leonardo de Moura a8c791ecae chore: remove dead files and functions
Remove obsolete combinators: `whenM`, `unlessM`, and `condM`

cc @Kha
2020-11-10 18:37:15 -08:00

30 lines
611 B
Text

import Lean.Meta
open Lean
open Lean.Meta
def checkM (x : MetaM Bool) : MetaM Unit :=
unless (← x) do throwError "check failed"
def tst1 : MetaM Unit := do
let nat := mkConst `Nat
let m1 ← mkFreshExprMVar nat
let m2 ← mkFreshExprMVar (← mkArrow nat nat)
withLocalDeclD `x nat fun x => do
let t := mkApp m2 x
checkM $ isDefEq t m1
def tst2 : MetaM Unit := do
let nat := mkConst `Nat
let m1 ← mkFreshExprMVar nat
let m2 ← mkFreshExprMVar (← mkArrow nat nat)
withLocalDeclD `x nat fun x => do
let t := mkApp m2 x
checkM $ isDefEq m1 t
set_option trace.Meta true
#eval tst1
#eval tst2