Flatten arguments fix in cloking.

This commit is contained in:
Léonard Gérard 2010-09-27 18:16:00 +02:00
parent 1e6ec0a7d0
commit 6da5171e6a
2 changed files with 4 additions and 6 deletions

View file

@ -195,11 +195,8 @@ let unalias_type ty =
with Undefined_type ln -> error (Eundefined (fullname ln))
let flatten_ty_list l =
let flatten = function
| Tprod l -> l
| ty -> [ty]
in
List.flatten (List.map flatten l)
List.fold_right
(fun arg args -> match arg with Tprod l -> l@args | a -> a::args ) l []
let rec unify t1 t2 =
match t1, t2 with

View file

@ -63,7 +63,8 @@ let rec typing h e =
and typing_op op e_list h e ck = match op with
| (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 ->
Cprod (List.map (typing h) e_list)
| Eifthenelse ->