From cd106cf13cbb84348489e2175f42ad9c25d0fbd8 Mon Sep 17 00:00:00 2001 From: Paul-Elliot Date: Thu, 12 Dec 2024 16:10:31 +0100 Subject: [PATCH] Compatibility --- src/loader/cmt.ml | 5 +++-- src/loader/cmti.ml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index 5f4ad66c08..b0aa51ee0b 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -395,12 +395,13 @@ let rec read_module_expr env parent label_parent mexpr = Functor (f_parameter, res) #else | Tmod_functor(id, _, arg, res) -> - let new_env = Env.add_parameter parent id (ModuleName.of_ident id) env in + let new_env = Env.add_parameter parent id (ModuleName.of_ident id) env.ident_env in + let new_env = {env with ident_env = new_env} in let f_parameter = match arg with | None -> FunctorParameter.Unit | Some arg -> - let id = Env.find_parameter_identifier new_env id in + let id = Env.find_parameter_identifier new_env.ident_env id in let arg = Cmti.read_module_type env (id :> Identifier.Signature.t) label_parent arg in Named { FunctorParameter. id; expr = arg; } in diff --git a/src/loader/cmti.ml b/src/loader/cmti.ml index 5e7b431d01..438964375b 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -546,12 +546,13 @@ and read_module_type env parent label_parent mty = Functor (f_parameter, res) #else | Tmty_functor(id, _, arg, res) -> - let new_env = Env.add_parameter parent id (ModuleName.of_ident id) env in + let new_env = Env.add_parameter parent id (ModuleName.of_ident id) env.ident_env in + let new_env = {env with ident_env = new_env} in let f_parameter = match arg with | None -> Odoc_model.Lang.FunctorParameter.Unit | Some arg -> - let id = Ident_env.find_parameter_identifier new_env id in + let id = Ident_env.find_parameter_identifier new_env.ident_env id in let arg = read_module_type env (id :> Identifier.Signature.t) label_parent arg in Named { FunctorParameter. id; expr = arg } in