diff --git a/compiler/heptagon/analysis/typing.ml b/compiler/heptagon/analysis/typing.ml index 8db61ac..0525fbd 100644 --- a/compiler/heptagon/analysis/typing.ml +++ b/compiler/heptagon/analysis/typing.ml @@ -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 diff --git a/compiler/minils/analysis/clocking.ml b/compiler/minils/analysis/clocking.ml index 2bc9cd5..c039007 100644 --- a/compiler/minils/analysis/clocking.ml +++ b/compiler/minils/analysis/clocking.ml @@ -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 ->