From 21aae319eee30f662f07ec992aa80c118727e203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Tue, 7 May 2013 17:09:58 +0200 Subject: [PATCH] Fixed linear typing of when It is always a read. One has to use the split operator for sampling linear variables. --- compiler/heptagon/analysis/linear_typing.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/heptagon/analysis/linear_typing.ml b/compiler/heptagon/analysis/linear_typing.ml index 4466999..f0fea11 100644 --- a/compiler/heptagon/analysis/linear_typing.ml +++ b/compiler/heptagon/analysis/linear_typing.ml @@ -446,8 +446,9 @@ let rec typing_exp env e = not_linear_for_exp e1, env | Eapp ({ a_op = Efield }, _, _) -> Ltop, env | Eapp ({ a_op = Earray }, _, _) -> Ltop, env + | Ewhen (e, _, _) -> lin_skeleton Ltop e.e_ty, env | Estruct _ -> Ltop, env - | Emerge _ | Ewhen _ | Esplit _ | Eapp _ | Eiterator _ -> assert false + | Emerge _ | Esplit _ | Eapp _ | Eiterator _ -> assert false in e.e_linearity <- l; l, env @@ -833,9 +834,6 @@ and expect env lin e = let env = List.fold_left (fun env (_, e) -> safe_expect env lin e) env c_e_list in lin, env - | Ewhen (e, _, _) -> - expect env lin e - | Esplit (c, e) -> let env = safe_expect env Ltop c in let l = linearity_list_of_linearity lin in