From 6da5171e6ad0506e51eec9824143f92a12fcca00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Mon, 27 Sep 2010 18:16:00 +0200 Subject: [PATCH] Flatten arguments fix in cloking. --- compiler/heptagon/analysis/typing.ml | 7 ++----- compiler/minils/analysis/clocking.ml | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) 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 ->