Skip to content

Quick fix for include functor #1368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/loader/cmt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,13 @@ and read_include env parent incl =
let container = (parent : Identifier.Signature.t :> Identifier.LabelParent.t) in
let doc, status = Doc_attr.attached ~warnings_tag:env.warnings_tag Odoc_model.Semantics.Expect_status container incl.incl_attributes in
let decl_modty =
match unwrap_module_expr_desc incl.incl_mod.mod_desc with
| Tmod_ident(p, _) ->
match unwrap_module_expr_desc incl.incl_mod.mod_desc, incl.incl_kind with
| Tmod_ident(p, _), Tincl_structure ->
let p = Env.Path.read_module env.ident_env p in
Some (ModuleType.U.TypeOf (ModuleType.StructInclude p, p))
| _, (Tincl_functor _ | Tincl_gen_functor _) ->
(* TODO: Handle [include functor] *)
None
| _ ->
let mty = read_module_expr env parent container incl.incl_mod in
umty_of_mty mty
Expand Down
5 changes: 3 additions & 2 deletions src/loader/cmti.ml
Original file line number Diff line number Diff line change
Expand Up @@ -769,11 +769,12 @@ and read_include env parent incl =
let expr = read_module_type env parent container incl.incl_mod in
let umty = Odoc_model.Lang.umty_of_mty expr in
let expansion = { content; shadowed; } in
match umty with
| Some uexpr ->
match umty, incl.incl_kind with
| Some uexpr, Tincl_structure ->
let decl = Include.ModuleType uexpr in
[Include {parent; doc; decl; expansion; status; strengthened=None; loc }]
| _ ->
(* TODO: Handle [include functor] *)
content.items

and read_open env parent o =
Expand Down
Loading