Version française
Home     About     Download     Resources     Contact us    
Browse thread
non-recursive recursive module segfault
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jeremy Yallop <jeremy.yallop@e...>
Subject: non-recursive recursive module segfault
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.