Skip to content

Commit

Permalink
No inlining for enum types
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-larraz committed Nov 2, 2023
1 parent ce89fa6 commit c2d6105
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lustre/lustreAstInlineConstants.ml
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,16 @@ let rec inline_constants_of_contract: TC.tc_context -> LA.contract -> LA.contrac
let substitute: TC.tc_context -> LA.declaration -> (TC.tc_context * LA.declaration) = fun ctx ->
function
| TypeDecl (span, AliasType (pos, i, t)) ->
let t' = inline_constants_of_lustre_type ctx t in
TC.add_ty_syn ctx i t', LA.TypeDecl (span, AliasType (pos, i, t'))
let ctx', t' =
match t with
| LA.EnumType _ ->
(* Special handling is applied to enum types (see type_check_infer_globals) *)
ctx, t
| _ ->
let t' = inline_constants_of_lustre_type ctx t in
TC.add_ty_syn ctx i t', t'
in
ctx', LA.TypeDecl (span, AliasType (pos, i, t'))
| ConstDecl (span, FreeConst (pos, id, ty)) ->
let ty' = inline_constants_of_lustre_type ctx ty in
ctx, ConstDecl (span, FreeConst (pos, id, ty'))
Expand Down

0 comments on commit c2d6105

Please sign in to comment.