From e9c24e387063c5798dd47114489ec5d8e37503e6 Mon Sep 17 00:00:00 2001 From: Rob Lorch Date: Wed, 13 Sep 2023 10:59:00 -0500 Subject: [PATCH] Fix bug with last commit --- src/lustre/lustreSyntaxChecks.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lustre/lustreSyntaxChecks.ml b/src/lustre/lustreSyntaxChecks.ml index 27c1e416b..0025650cd 100644 --- a/src/lustre/lustreSyntaxChecks.ml +++ b/src/lustre/lustreSyntaxChecks.ml @@ -832,10 +832,12 @@ and check_expr ctx f (expr:LustreAst.expr) = (check_expr ctx f e1) >> (check_expr ctx f e2) >> (check_expr_list ctx f e3) | RestartEvery (_, _, e1, e2) -> (check_expr_list ctx f e1) >> (check_expr ctx f e2) - | ChooseOp (_, _, e1, None) -> - (check_expr ctx f e1) - | ChooseOp (_, _, e1, Some e2) -> - (check_expr ctx f e1) >> (check_expr ctx f e2) + | ChooseOp (_, (_, i, ty), e1, None) -> + let extn_ctx = ctx_add_local ctx i (Some ty) in + (check_expr extn_ctx f e1) + | ChooseOp (_, (_, i, ty), e1, Some e2) -> + let extn_ctx = ctx_add_local ctx i (Some ty) in + (check_expr extn_ctx f e1) >> (check_expr extn_ctx f e2) | _ -> Ok () in expr' >> r