From 52486af6ac30ab5de4da6c0b25a33db8cdcd2c71 Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Thu, 2 Nov 2023 15:43:44 +0100 Subject: [PATCH] Correct typing of context subscope variables --- compiler/scopelang/from_desugared.ml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/scopelang/from_desugared.ml b/compiler/scopelang/from_desugared.ml index ae2acd00..1a8b5982 100644 --- a/compiler/scopelang/from_desugared.ml +++ b/compiler/scopelang/from_desugared.ml @@ -620,6 +620,17 @@ let translate_rule (D.ScopeDef.Map.find def_key exc_graphs) ~is_cond ~is_subscope_var:true in + let def_typ = + match scope_def.D.scope_def_io.D.io_input with + | Runtime.NoInput, _ -> assert false + | Runtime.OnlyInput, _ -> def_typ + | Runtime.Reentrant, pos -> + match def_typ with + | TArrow (args, ret), tpos -> + TArrow (args, (TDefault ret, pos)), tpos + | _ -> + TDefault def_typ, pos + in let subscop_real_name = SubScopeName.Map.find sub_scope_index scope.scope_sub_scopes in