Original bug ID: 6563 Reporter:@mshinwell Assigned to:@garrigue Status: closed (set by @xavierleroy on 2016-12-07T10:34:44Z) Resolution: fixed Priority: high Severity: minor Version: 4.02.1+dev Fixed in version: 4.02.1+dev Category: typing Monitored by:@diml@yakobowski
Bug description
I'm not completely sure this is a bug, but I suspect it is.
$ cat a.ml
let () = Printf.printf "a is loaded\n%!"
$ cat b.ml
include (Pack : sig end)
$ ocamlopt -c -for-pack Pack a.ml
$ ocamlopt -pack a.cmx -o pack.cmx
$ ocamlopt -a pack.cmx -o pack.cmxa
$ ocamlopt -c b.ml
$ ocamlopt pack.cmxa b.cmx
$ ./a.out
When run on 4.01, the printf statement executes.
With 4.02, it does not.
The text was updated successfully, but these errors were encountered:
Interesting.
It doesn't seem to be related to module aliases, but may be the consequence of some extra simplifications on lambda-code involving modules.
I'm still confused at why your b.ml and the following c.ml end up being compiled differently:
include (A : sig end)
Just reverting a StrictOpt to Strict solved the problem, with
no other side-effects (since there is a coercion, this is not
a module alias).
Actually this is not related to pack: you could obtain
the same result by coercing a non-empty signature to
an empty one:
$ cat a.ml
let () = Printf.printf "a is loaded\n%!"
let x = 3
$ cat c.ml
include (A : sig end)
$ ocamlopt -c a.ml
$ ocamlopt -c c.ml
$ ocamlopt c.cmx -o c.opt # !!!
Original bug ID: 6563
Reporter: @mshinwell
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:34:44Z)
Resolution: fixed
Priority: high
Severity: minor
Version: 4.02.1+dev
Fixed in version: 4.02.1+dev
Category: typing
Monitored by: @diml @yakobowski
Bug description
I'm not completely sure this is a bug, but I suspect it is.
$ cat a.ml
let () = Printf.printf "a is loaded\n%!"
$ cat b.ml
include (Pack : sig end)
$ ocamlopt -c -for-pack Pack a.ml
$ ocamlopt -pack a.cmx -o pack.cmx
$ ocamlopt -a pack.cmx -o pack.cmxa
$ ocamlopt -c b.ml
$ ocamlopt pack.cmxa b.cmx
$ ./a.out
When run on 4.01, the printf statement executes.
With 4.02, it does not.
The text was updated successfully, but these errors were encountered: