caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremy Yallop <jeremy.yallop@ed.ac.uk>
To: caml-list@inria.fr
Subject: non-recursive recursive module segfault
Date: Wed, 09 Aug 2006 14:51:32 +0100	[thread overview]
Message-ID: <44D9E864.4000303@ed.ac.uk> (raw)

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.


             reply	other threads:[~2006-08-09 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09 13:51 Jeremy Yallop [this message]
2006-08-09 14:30 ` [Caml-list] " Alain Frisch
2006-08-09 14:56   ` Jeremy Yallop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44D9E864.4000303@ed.ac.uk \
    --to=jeremy.yallop@ed.ac.uk \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).