lean4-htt/tests/lean/run/eval_unboxed_const.lean
Leonardo de Moura 44f5182f76 chore: fix tests
We have removed `MetaIO`. We use use `CoreM` instead.
2020-08-20 15:56:29 -07:00

20 lines
468 B
Text

import Lean
open Lean
def c1 : Bool := true
unsafe def tst1 : CoreM Unit := do
env ← Core.getEnv;
let v := env.evalConst Bool `c1;
IO.println v
#eval tst1 -- outputs incorrect value (ok false). Reason: the unboxed value `true` is `1`, but the boxed `false` value is also `1`.
def c2 : Bool := false
unsafe def tst2 : CoreM Unit := do
env ← Core.getEnv;
let v := env.evalConst Bool `c2;
IO.println v
#eval tst2 -- crashes since `0` is not a valid boxed value