Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Incorrect module initialisation order with "external" declarations #4166
Original bug ID: 4166
We have a module (lets call it "Foo") that interfaces C-bindings and exports functions defined as "external" in its .mli-file. This module is packed with others into one module, which again is part of a .cmxa-file.
If we link this library with another module (say, "Bar") that uses only functions defined "external" in "Foo", we observed that toplevel expressions in "Foo" did not get evaluated.
Here is a schematic example:
external foo : unit -> unit = "foo"
let () =