caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Markus Mottl" <markus.mottl@gmail.com>
To: "Stephen Weeks" <sweeks@janestcapital.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] type unsoundness with constraints and polymorphic variants
Date: Mon, 11 Feb 2008 15:46:17 -0500	[thread overview]
Message-ID: <f8560b80802111246o42ddbeccybbe0ba6757c961e8@mail.gmail.com> (raw)
In-Reply-To: <18352.43565.401296.820373@nyc-qws-r03.delacy.com>

On Feb 11, 2008 3:03 PM, Stephen Weeks <sweeks@janestcapital.com> wrote:
> Here is a distillation of the bug.  If you compile this, you get a
> warning about line 11 being an unused case.  If you then run the
> resulting executable, you get a segfault.

Line 11 can obviously be deleted, the segfault still persists.  The
unsoundness seems to appear when the signature constraint is applied
to the module.  It should fail, because the identity function is
clearly not a valid instance of this type, since `X can be passed to
it and it would just be returned, thus violating the return type.

It seems that constraints on polymorphic variables are not handled
correctly during the unification of the contents of the module with
its signature.

Regards,
Markus

-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


  reply	other threads:[~2008-02-11 20:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-11 20:03 Stephen Weeks
2008-02-11 20:46 ` Markus Mottl [this message]
2008-02-12  4:22 ` [Caml-list] " Jacques Garrigue
2008-02-12 10:35   ` Andrej Bauer
2008-02-12 14:43     ` Luc Maranget
2008-02-13  8:00     ` Jacques Garrigue
2008-02-13 14:15       ` Christopher L Conway
2008-02-13 14:18         ` Michael Hicks
2008-02-13 14:22           ` David Teller
2008-02-13 14:35           ` Till Varoquaux
2008-02-13 14:52             ` Michael Hicks
2008-02-13 14:53             ` Mattias Engdegård
2008-02-13 15:55               ` Christopher L Conway
2008-02-13 16:53             ` Stefano Zacchiroli

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=f8560b80802111246o42ddbeccybbe0ba6757c961e8@mail.gmail.com \
    --to=markus.mottl@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=sweeks@janestcapital.com \
    /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).