Modules opened in the wrong order?
I get an error when I edit file link.ml even though Dune compiles it just fine.
When compiling the library Wasm_of_ocaml_compiler which contains this file, I also open the library Js_of_ocaml_compiler. Both libraries contain a file generate.ml.
(library
(name wasm_of_ocaml_compiler)
(libraries js_of_ocaml_compiler)
(flags
(:standard -w -7-37 -safe-string -open Js_of_ocaml_compiler))
[...]
I suspect what happens is that merlin and dune do not perform the opens in the same order.
Adding an explicit open flag, even in the wrong order, seems to work around the issue.
(flags
(:standard -w -7-37 -safe-string -open Wasm_of_ocaml_compiler -open Js_of_ocaml_compiler))
I have taken a dump of the configuration.
Thanks for the report Jérôme. That's indeed very suspicious. I will try to find some time to investigate, meanwhile, do you think you could craft a smaller reproduction ?
- unzip merlin-bug.zip
-
cd merlin-bug -
dune exec -- ./main.exe - Open
main.mlin your editor
Thanks a lot, I added your example to the testsuite and proposed a change in Dune. The ordering is indeed wrong in the generated configuration. (but not in Merlin's treatment of the ordering)
Thanks !