You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6923 Reporter:@let-def Assigned to:@garrigue Status: closed (set by @xavierleroy on 2017-02-16T14:15:10Z) Resolution: not a bug Priority: normal Severity: minor Version: 4.02.2 Category: ~DO NOT USE (was: OCaml general) Monitored by:@gasche@diml
Bug description
When a module is defined only with an mli file (no implementation) and then referred to with a module alias, compilation fails at linking step with message:
Error: No implementations provided for the following modules:
Parsetree referenced from src/ocaml/raw_compat.cmx
Steps to reproduce
b.mli : type t
a.ml : module B = B
$ ocamlopt b.mli a.ml
File "a.ml", line 1:
Error: No implementations provided for the following modules:
B referenced from a.cmx
The text was updated successfully, but these errors were encountered:
The point is that you will see the same behavior with old versions of ocaml.
Without -no-alias-deps, module aliases behave just like real modules, and making a copy of a module requires an implementation.
Note however that the old workaround to create a module from a signature does work:
module rec M : module type of struct include B end = M
Yes, old versions of ocaml have the same behavior, but what is worrying in the current situation is that I have to know how a module is implemented to be able to reexport it.
In the case of compiler-libs,
module Ast_helper = Ast_helper
…
module rec Parsetree0 : module type of struct include Parsetree end = Parsetree0
And the workaround doesn't seem to work: after changing a.ml from my example with the line you gave, I still get the same error message.
Original bug ID: 6923
Reporter: @let-def
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:15:10Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 4.02.2
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche @diml
Bug description
When a module is defined only with an mli file (no implementation) and then referred to with a module alias, compilation fails at linking step with message:
Error: No implementations provided for the following modules:
Parsetree referenced from src/ocaml/raw_compat.cmx
Steps to reproduce
b.mli : type t
a.ml : module B = B
$ ocamlopt b.mli a.ml
File "a.ml", line 1:
Error: No implementations provided for the following modules:
B referenced from a.cmx
The text was updated successfully, but these errors were encountered: