lean4-htt/tests/lean/toExpr.lean
2024-02-23 15:16:12 -08:00

21 lines
434 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Lean
open Lean BitVec
open Meta in
def test [ToExpr α] (a : α) : MetaM Unit := do
let e := toExpr a
let type ← inferType e
check e
logInfo m!"{e} : {type}"
run_meta test (2 : Fin 4)
run_meta test (8 : Fin 5)
run_meta test (300#8)
run_meta test (300#32)
run_meta test (58#8)
run_meta test (20 : UInt8)
run_meta test (30 : UInt16)
run_meta test (40 : UInt32)
run_meta test (50 : UInt64)
run_meta test (60 : USize)