diff --git a/unittest/core-ast/t1.expected b/unittest/core-ast/t1.expected index 41db5eae..f64d188c 100644 --- a/unittest/core-ast/t1.expected +++ b/unittest/core-ast/t1.expected @@ -2,3 +2,11 @@ type0 : type typeof(type0) : type_1 type tower: [type;type_1;type_2;type_3;type_4;type_5;type_6;type_7;type_8; type_9] +a: a, b: b, typeof(a): Bool +pi Bool Bool +b2b: (Bool -> Bool) +p(a): p a +p(b): p b +q(a): q a +q(b): q b +typeof(p a): Bool diff --git a/unittest/core-ast/t1.ml b/unittest/core-ast/t1.ml index c599fcdf..04872627 100644 --- a/unittest/core-ast/t1.ml +++ b/unittest/core-ast/t1.ml @@ -11,3 +11,29 @@ let l = let () = Fmt.printf "type tower: %a@." (Fmt.Dump.list pp_debug) l let () = assert (equal (type_ store) (type_ store)) +let bool = Str_const.const store "Bool" ~ty:(type_ store) +let a = Str_const.const store "a" ~ty:bool +let a' = Str_const.const store "a" ~ty:bool +let b = Str_const.const store "b" ~ty:bool + +let () = + Fmt.printf "a: %a, b: %a, typeof(a): %a@." pp_debug a pp_debug b pp_debug + (ty_exn a) + +let () = assert (equal a a) +let () = assert (not (equal a b)) +let ty_b2b = arrow store bool bool +let () = Fmt.printf "b2b: %a@." pp_debug ty_b2b +let p = Str_const.const store "p" ~ty:ty_b2b +let q = Str_const.const store "q" ~ty:ty_b2b +let pa = app store p a +let pb = app store p b +let qa = app store q a +let qb = app store q b +let () = Fmt.printf "p(a): %a@." pp_debug pa +let () = Fmt.printf "p(b): %a@." pp_debug pb +let () = Fmt.printf "q(a): %a@." pp_debug qa +let () = Fmt.printf "q(b): %a@." pp_debug qb +let () = assert (equal pa (app store p a)) +let ty_pa = ty_exn pa +let () = Fmt.printf "typeof(p a): %a@." pp_debug ty_pa