diff --git a/src/lustre/typeCheckerContext.ml b/src/lustre/typeCheckerContext.ml index b57ba69a8..f7ac655dd 100644 --- a/src/lustre/typeCheckerContext.ml +++ b/src/lustre/typeCheckerContext.ml @@ -147,22 +147,24 @@ let rec lookup_ty_syn: tc_context -> LA.ident -> tc_type list -> tc_type option match (IMap.find_opt i (ctx.ty_syns), IMap.find_opt i (ctx.ty_ty_vars)) with | Some ty, Some ps -> let sigma = List.combine ps ty_args in - let ty = LustreAstHelpers.apply_type_subst_in_type sigma ty in - (match ty with - | LA.UserType (_, ty_args, uid) -> - if uid = i - then Some ty - else lookup_ty_syn ctx uid ty_args - | _ -> Some ty) + let ty = LustreAstHelpers.apply_type_subst_in_type sigma ty in ( + match ty with + | LA.UserType (_, ty_args, uid) -> + if uid = i + then Some ty + else lookup_ty_syn ctx uid ty_args + | _ -> Some ty + ) | Some ty, None -> let sigma = List.combine [] ty_args in - let ty = LustreAstHelpers.apply_type_subst_in_type sigma ty in - (match ty with - | LA.UserType (_, ty_args, uid) -> - if uid = i - then Some ty - else lookup_ty_syn ctx uid ty_args - | _ -> Some ty) + let ty = LustreAstHelpers.apply_type_subst_in_type sigma ty in ( + match ty with + | LA.UserType (_, ty_args, uid) -> + if uid = i + then Some ty + else lookup_ty_syn ctx uid ty_args + | _ -> Some ty + ) | _ -> None (** Picks out the type synonym from the context If it is user type then chases it (recursively looks up) diff --git a/src/lustre/typeCheckerContext.mli b/src/lustre/typeCheckerContext.mli index 0e799df91..eb6a8f2d3 100644 --- a/src/lustre/typeCheckerContext.mli +++ b/src/lustre/typeCheckerContext.mli @@ -117,7 +117,7 @@ val lookup_contract_ty_vars: tc_context -> HString.t -> HString.t list option (** Lookup a contract's type variables *) val lookup_ty_ty_vars: tc_context -> HString.t -> HString.t list option -(** Lookup a type's type variables *) +(** Lookup a user type's type variables *) val lookup_node_param_attr: tc_context -> LA.ident -> (HString.t * bool) list option (** Track whether node parameters are constant or not *)