Flatten arguments fix in cloking.
This commit is contained in:
parent
1e6ec0a7d0
commit
6da5171e6a
|
@ -195,11 +195,8 @@ let unalias_type ty =
|
||||||
with Undefined_type ln -> error (Eundefined (fullname ln))
|
with Undefined_type ln -> error (Eundefined (fullname ln))
|
||||||
|
|
||||||
let flatten_ty_list l =
|
let flatten_ty_list l =
|
||||||
let flatten = function
|
List.fold_right
|
||||||
| Tprod l -> l
|
(fun arg args -> match arg with Tprod l -> l@args | a -> a::args ) l []
|
||||||
| ty -> [ty]
|
|
||||||
in
|
|
||||||
List.flatten (List.map flatten l)
|
|
||||||
|
|
||||||
let rec unify t1 t2 =
|
let rec unify t1 t2 =
|
||||||
match t1, t2 with
|
match t1, t2 with
|
||||||
|
|
|
@ -63,7 +63,8 @@ let rec typing h e =
|
||||||
|
|
||||||
and typing_op op e_list h e ck = match op with
|
and typing_op op e_list h e ck = match op with
|
||||||
| (Eequal | Efun _ | Enode _) ->
|
| (Eequal | Efun _ | Enode _) ->
|
||||||
(List.iter (expect h (Ck ck)) e_list; skeleton ck e.e_ty)
|
List.iter (fun e -> expect h (skeleton ck e.e_ty) e) e_list;
|
||||||
|
skeleton ck e.e_ty
|
||||||
| Etuple ->
|
| Etuple ->
|
||||||
Cprod (List.map (typing h) e_list)
|
Cprod (List.map (typing h) e_list)
|
||||||
| Eifthenelse ->
|
| Eifthenelse ->
|
||||||
|
|
Loading…
Reference in a new issue