From: "Jun Furuse" <jun.furuse@gmail.com>
To: "caml users" <caml-list@inria.fr>
Subject: A bug(?) around phantoms in 3.11.0 b1 (Re: [Caml-list] OCaml version 3.11.0+beta1)
Date: Tue, 21 Oct 2008 16:15:25 +0900 [thread overview]
Message-ID: <5160b4200810210015q720ae14dx8cf4a5fa05ae6e30@mail.gmail.com> (raw)
Hi,
I found a strange bug in 3.11.0 beta 1. The following typical example
of phantom types does not compile any more. (It is compilable in
3.10.2, but not in release311):
module M : sig
type +'a t constraint 'a = [< `checked | `unchecked ]
val check : _ t -> [ `checked ] t
end = struct
type +'a t = { x : int } constraint 'a = [< `checked | `unchecked ]
let check (t : _ t) = t (* actually it grants anything *)
end
A strange thing is that if I change the definition as follows it compiles!
module M : sig
type +'a t constraint 'a = [< `checked | `unchecked ]
val check : _ t -> [ `checked ] t
end = struct
type u = { x : int } (* strange workaround *)
type +'a t = u constraint 'a = [< `checked | `unchecked ]
let check (t : _ t) = t (* actually it grants anything *)
end
=
j
next reply other threads:[~2008-10-21 7:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-21 7:15 Jun Furuse [this message]
2008-10-21 8:32 ` A bug(?) around phantoms in 3.11.0 b1 Jacques Garrigue
2008-10-21 9:21 ` Jun Furuse
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=5160b4200810210015q720ae14dx8cf4a5fa05ae6e30@mail.gmail.com \
--to=jun.furuse@gmail.com \
--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