Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
simple recursive value not accepted #5054
Original bug ID: 5054
I can't think of any reason this should fail, and the documentation about "statically constructive" expressions would seem to allow it.
jeremy:~$ ocamlc -c minimal.ml
module type POINTED_SET = sig
module IntWith3 : POINTED_SET = struct
(* all of these are fine *)
(* but this causes an error! *)
On Snow Leopard.
Comment author: @alainfrisch
This is caused by this case in Translcore.check_recursive_lambda:
This was introduced in rev 7742 ( http://caml.inria.fr/cgi-bin/viewcvs.cgi/ocaml/version/3.09/bytecomp/translcore.ml?rev=7742&r1=7175&r2=7742 ) as part of the fix for #4141.
Damien: do you remember the reason for this case? It seems to me that the default behavior (accepting the array expression if it does not refer to any variable defined in the current let-rec) should be sound.
Comment author: @damiendoligez
I don't remember exactly, but looking at the code I see there is a trap with generic arrays:
I'll implement that and do some testing.