From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p65ErgPC015730 for ; Tue, 5 Jul 2011 16:53:47 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AssHALEkE05beZio/2dsb2JhbABThEKUSI52d4h8sRyQV4ErggmBdoEMBKJu X-IronPort-AV: E=Sophos;i="4.65,479,1304287200"; d="scan'208";a="98020757" Received: from quare.fr ([91.121.152.168]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 05 Jul 2011 16:53:47 +0200 Received: from bohrium.pps.jussieu.fr ([134.157.168.107]) by quare.fr with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Qe70U-0007WD-U6 for caml-list@inria.fr; Tue, 05 Jul 2011 16:53:46 +0200 From: Mathias Kende To: caml-list@inria.fr In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Tue, 05 Jul 2011 16:54:40 +0200 Message-ID: <1309877680.23478.17.camel@bohrium.pps.jussieu.fr> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p65ErgPC015730 Subject: Re: [Caml-list] Type inference and marshalling 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 = 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