caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Misha Aizatulin <avatar@hot.ee>
To: caml-list@inria.fr
Subject: [Caml-list] typechecking
Date: Sat, 22 Mar 2014 20:02:22 +0000	[thread overview]
Message-ID: <532DEC4E.6040505@hot.ee> (raw)


  Using ocaml 4.00.1 the program below successfully compiles. I think
this should be rejected because the call (f t) forces t to be of type t2
whereas the annotation on input function requires it to be of type t1.

type t1 = T1
type t2 = T2

let f T2 = ()

let input (c : in_channel) : t1 =
  let t = input_value c in
  f t;
  t

             reply	other threads:[~2014-03-22 20:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-22 20:02 Misha Aizatulin [this message]
2014-03-22 20:40 ` Daniel Bünzli
2014-03-22 22:12   ` Yaron Minsky
2014-03-22 22:24     ` Jonathan Protzenko
2014-03-23  4:41 ` oleg
2014-03-23 12:59   ` Jacques Garrigue
2014-03-24  8:46     ` Alain Frisch

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=532DEC4E.6040505@hot.ee \
    --to=avatar@hot.ee \
    --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).