caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* non-recursive recursive module segfault
@ 2006-08-09 13:51 Jeremy Yallop
  2006-08-09 14:30 ` [Caml-list] " Alain Frisch
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Yallop @ 2006-08-09 13:51 UTC (permalink / raw)
  To: caml-list

What behaviour should I expect for the following code? :

   module rec M :
   sig
     val m : unit -> unit
   end
     =
   struct
     let h _ _ = ()
     let m = h ()
   end

   let _ = M.m ()

According to the documentation this could trigger the exception 
"Undefined_recursive_module", but instead it segfaults.  If I remove the 
`rec' keyword then it "works", i.e. simply returns unit.

I was rather hoping that M would be treated as a non-recursive module, 
despite the `rec', since it's not actually recursive.  It's easy enough 
to avoid the segmentation fault: eta-expanding m, adding a trivial value 
component to the signature, removing `rec', etc., but I was hoping the 
compiler would help out in this case.

In any case, should the segmentation fault be considered a bug?

This is on OCaml 3.09.2/Linux/x86.

Jeremy.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-09 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-09 13:51 non-recursive recursive module segfault Jeremy Yallop
2006-08-09 14:30 ` [Caml-list] " Alain Frisch
2006-08-09 14:56   ` Jeremy Yallop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).