Commit 31fd33bc authored by Julien Lopez's avatar Julien Lopez
Browse files

[TESTS][LAMBDA][MINOR] Fix type for polymorphic variables (no sigma yet)

parent ce3a405c
......@@ -19,7 +19,7 @@ let type_of_string s = match s with
let rec type_of_ptype arg = match arg with
| Type(t) -> type_of_string t
| PType(t) -> any (* TODO: Check this solution *)
| PType(t) -> var (`Var (Var.make_id t)) (* TODO: Add sigma *)
| TPair(t1, t2) -> times (cons (type_of_ptype t1)) (cons (type_of_ptype t2))
| TUnion(t1, t2) -> cup (type_of_ptype t1) (type_of_ptype t2)
| TInter(t1, t2) -> cap (type_of_ptype t1) (type_of_ptype t2)
......
......@@ -143,8 +143,11 @@ let tests = "CDuce runtime tests" >:::
);
"poly" >:: ( fun test_ctxt ->
(* TODO: Abstraction((`$A & Int | [Char*], `$A & Int | [Char*])) *)
assert_equal ~msg:"Test CDuce.runtime.poly.identity failed"
~printer:(fun x -> x) "Abstraction((Any, Any))"
~printer:(fun x -> x)
"Abstraction((`$A & Int | Char | Atom | (Any,Any) | <(Any) (Any)>Any | \
Arrow, `$A & Int | Char | Atom | (Any,Any) | <(Any) (Any)>Any | Arrow))"
(run_test "((fun f x : 'A : 'A -> x){A/Int;A/String})");
assert_equal ~msg:"Test CDuce.runtime.poly.identity_applied failed"
~printer:(fun x -> x) "2"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment