From: Mathias Kende <mathias@kende.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Type inference and marshalling
Date: Tue, 05 Jul 2011 16:54:40 +0200 [thread overview]
Message-ID: <1309877680.23478.17.camel@bohrium.pps.jussieu.fr> (raw)
In-Reply-To: <CAOg1smDRVEhk7BUqNOpetb_-P4LND=+Ad9hwYGHstK4OF4tqsA@mail.gmail.com>
Le mardi 05 juillet 2011 à 15:18 +0100, Wojciech Meyer a écrit :
> The unused binding j is not taken account and thrown away, so the type
> system will not take into account + operator that will cause i to be int.
> Why the unused binding is being thrown away before type checker, I don't
> know, maybe somebody could explain possibly.
This is not the reason for the acceptance of this input because the
following also typecheck (in 3.12.0):
let f ic =
let i = input_value ic in
let j = i + 1 in
(j, i, LargeFile.seek_in ic i);
with (apparently wrong) type:
val f : in_channel -> int * 'a * unit = <fun>
This looks like a bug in the type checker.
A smaller triggering program is:
let f () =
let i = input_value stdin in
let j = i + 1 in
i, j;;
Mathias
next prev parent reply other threads:[~2011-07-05 14:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 13:59 malc
2011-07-05 14:18 ` Wojciech Meyer
2011-07-05 14:54 ` Mathias Kende [this message]
2011-07-05 23:24 ` Jacques Garrigue
2011-07-06 5:11 ` malc
2011-07-06 7:44 ` Jacques Garrigue
2011-07-06 8:31 ` malc
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=1309877680.23478.17.camel@bohrium.pps.jussieu.fr \
--to=mathias@kende.fr \
--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