From eb85bfd28275ec01c191e4beb8fc67eeadbd3050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Mon, 12 Jul 2010 10:22:57 +0200 Subject: [PATCH] Fix for tuple consts in Initialization We also need a skeleton fun for consts as there can be a const tuple TODO : do the same in Clocking ?? --- compiler/heptagon/analysis/initialization.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/heptagon/analysis/initialization.ml b/compiler/heptagon/analysis/initialization.ml index 4bc9946..c251cd2 100644 --- a/compiler/heptagon/analysis/initialization.ml +++ b/compiler/heptagon/analysis/initialization.ml @@ -94,6 +94,11 @@ let rec skeleton i ty = | Tprod(ty_list) -> product (List.map (skeleton i) ty_list) | _ -> leaf i +let rec const_skeleton i se = + match se.se_desc with + | Stuple l -> product (List.map (const_skeleton i) l) + | _ -> leaf i + (* sub-typing *) let rec less left_ty right_ty = if left_ty == right_ty then () @@ -186,7 +191,7 @@ let less_exp e actual_ty expected_ty = (** Main typing function *) let rec typing h e = match e.e_desc with - | Econst _ -> leaf izero + | Econst c -> const_skeleton izero c | Evar(x) | Elast(x) -> let { i_typ = i } = Env.find x h in leaf i | Epre(None, e) -> initialized_exp h e;