Skip to content

Commit

Permalink
Compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd committed Dec 13, 2024
1 parent ec42df0 commit cd106cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/loader/cmt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/loader/cmti.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cd106cf

Please sign in to comment.