Skip to content

OpaqueModule is not necessarily an error #732

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

Merged
merged 2 commits into from
Sep 23, 2021
Merged
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
1 change: 1 addition & 0 deletions src/xref2/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ and module_type_expr :
| Ok (_, _, ce) ->
let e = Lang_of.simple_expansion Lang_of.empty id ce in
Some (simple_expansion env id e)
| Error `OpaqueModule -> None
| Error e ->
Errors.report ~what:(`Module_type_expr ce) ~tools_error:e `Expand;
None)
Expand Down
2 changes: 0 additions & 2 deletions src/xref2/paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ type t = F(M).N.t

```ocaml env=e1
# let sg = Common.compile_signature (Common.signature_of_mli_string example)
File "<test>":
Failed to compile expansion for module type expression identifier((param (root Root).F X), false).S OpaqueModule
val sg : Odoc_model.Lang.Signature.t =
{Odoc_model.Lang.Signature.items =
[Odoc_model.Lang.Signature.ModuleType
Expand Down
16 changes: 0 additions & 16 deletions test/xref2/resolve/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,10 +858,6 @@ Ensure a substitution is taken into account during resolution:

type t = C.N.t
|}
File "<test>":
Failed to compile expansion for module type expression identifier((root Root).A.M, false).S OpaqueModule
File "<test>":
Failed to compile expansion for module type expression identifier((root Root).A.M, false).S OpaqueModule
- : Odoc_model.Lang.Compilation_unit.t =
{Odoc_model.Lang.Compilation_unit.id =
`Root (Some (`Page (None, None)), Root);
Expand Down Expand Up @@ -995,10 +991,6 @@ Ensure a destructive substitution is taken into account during resolution:

type t = C.N.t
|}
File "<test>":
Failed to compile expansion for module type expression identifier((root Root).A.M, false).S OpaqueModule
File "<test>":
Failed to compile expansion for module type expression identifier((root Root).A.M, false).S OpaqueModule
- : Odoc_model.Lang.Compilation_unit.t =
{Odoc_model.Lang.Compilation_unit.id =
`Root (Some (`Page (None, None)), Root);
Expand Down Expand Up @@ -1637,14 +1629,6 @@ Functor app nightmare:
type t = resolved[(global(Bar).T subst-> global(App)(resolved[global(Bar)])(resolved[global(Foo)])(resolved[global(FooBarInt)]).Foo).bar]
*)
|}
File "<test>":
Failed to compile expansion for module type expression identifier((param (root Root).Foo T), false).T OpaqueModule
File "<test>":
Failed to compile expansion for module type expression identifier((param (root Root).Foo T), false).T OpaqueModule
File "<test>":
Failed to compile expansion for module type expression identifier((param (root Root).App.result F), false)(identifier((param (root Root).App T), false)).T OpaqueModule
File "<test>":
Failed to compile expansion for module type expression identifier((param (root Root).App.result F), false)(identifier((param (root Root).App T), false)).T OpaqueModule
- : Odoc_model.Lang.Compilation_unit.t =
{Odoc_model.Lang.Compilation_unit.id =
`Root (Some (`Page (None, None)), Root);
Expand Down