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: 6572 Reporter: acieroid Assigned to:@garrigue Status: closed (set by @xavierleroy on 2016-12-07T10:34:52Z) Resolution: fixed Priority: normal Severity: minor OS: Linux 3.14.18 Version: 4.02.0+beta1 / +rc1 Fixed in version: 4.02.1+dev Category: ~DO NOT USE (was: OCaml general) Monitored by:@hcarty
Bug description
Code involving recursive modules can make the compiler crash
Steps to reproduce
Minimal example to reproduce (use batteries' BatSet):
module rec A : Set.OrderedType = struct
type t = int
let compare = Pervasives.compare
end
and B : BatSet.S = struct
module C = BatSet.Make(A)
include C
end
Compile with ocamlfind ocamlc -c -package batteries -o foo.cmo foo.ml, which produces the following error:
C/1386
Fatal error: Bytegen.comp_expr: var C_1386
Fatal error: exception Misc.Fatal_error
Additional information
Using OCaml's Set instead of BatSet makes the bug disappear
Replacing the B module definition from struct ... end to BatSet.Make(A) also makes the bug disappear
As this example doesn't actually need recursive modules, switching to normal modules also makes the bug disappear
OCaml version is 4.02 (worked fine on 4.01)
Batteries version is latest commit on master branch
The text was updated successfully, but these errors were encountered:
Thank you very much for this report.
There was something fishy in Translmod.transl_structure
(some parameter was ignored), but I couldn't find a
counterexample. Thanks to this one, the code seems now
correct.
Original bug ID: 6572
Reporter: acieroid
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:34:52Z)
Resolution: fixed
Priority: normal
Severity: minor
OS: Linux 3.14.18
Version: 4.02.0+beta1 / +rc1
Fixed in version: 4.02.1+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @hcarty
Bug description
Code involving recursive modules can make the compiler crash
Steps to reproduce
Minimal example to reproduce (use batteries' BatSet):
module rec A : Set.OrderedType = struct
type t = int
let compare = Pervasives.compare
end
and B : BatSet.S = struct
module C = BatSet.Make(A)
include C
end
Compile with
ocamlfind ocamlc -c -package batteries -o foo.cmo foo.ml
, which produces the following error:C/1386
Additional information
The text was updated successfully, but these errors were encountered: