From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 299837FACD for ; Tue, 16 Sep 2014 13:35:05 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of agarwal1975@gmail.com) identity=pra; client-ip=209.85.216.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of agarwal1975@gmail.com designates 209.85.216.176 as permitted sender) identity=mailfrom; client-ip=209.85.216.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="agarwal1975@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qc0-f176.google.com) identity=helo; client-ip=209.85.216.176; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="agarwal1975@gmail.com"; x-sender="postmaster@mail-qc0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUBAAMfGFTRVdiwlGdsb2JhbABhg2BXBIJ4xjCBZodSAYEMCBYBEQEBAQEHCwsJEiyEBAEBAwESEQQZARseAwELBgMCBAc3AgIhAQERAQUBHAYTIogHAQMJCIhokCprizCBcoMQiTUKGScNZoYbAREBBQ6NEB2CDAuCeIFTBZYEhHaCEIFfjSOEUBgpgxgegXUhL4JKAQEB X-IPAS-Result: ArUBAAMfGFTRVdiwlGdsb2JhbABhg2BXBIJ4xjCBZodSAYEMCBYBEQEBAQEHCwsJEiyEBAEBAwESEQQZARseAwELBgMCBAc3AgIhAQERAQUBHAYTIogHAQMJCIhokCprizCBcoMQiTUKGScNZoYbAREBBQ6NEB2CDAuCeIFTBZYEhHaCEIFfjSOEUBgpgxgegXUhL4JKAQEB X-IronPort-AV: E=Sophos;i="5.04,534,1406584800"; d="scan'208";a="96057251" Received: from mail-qc0-f176.google.com ([209.85.216.176]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 16 Sep 2014 13:35:04 +0200 Received: by mail-qc0-f176.google.com with SMTP id x13so3416995qcv.7 for ; Tue, 16 Sep 2014 04:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=GNQ/qr16OKi4MLzCR9gpReq4Q6dqYAC30YPVmK5+RJE=; b=apK2r8bwe3wSwEdBMaSN+96xYA7IZzwme0UPVgoJpvEiA1iqVlP4NHqBG8dSQZJTZV HB3lwXm96bKfWh89FbBMVrH4Wi2cNycK0NzKXBXzBcTLYCBWjpygtPqeu+DWFmSOtikD kyP+tZcCjiKg0kvwN/GAW8jGvmtNZUaWsiGuP6bu4VoV+65ExoXlOXdpGMwoPXZc+TUg 2JTWmUtbPxDSwCCnK65darhgFr3U32n9zUE085W+w6d02m19Nt3nMiATSt2rvvC0X3tD ZztmIqbZuErwbxWa25iXoRIZ1CX/0MPDp/0X0VHEbuJsnXnSxG+FkyKG57wuT7CogmcD nLAg== X-Received: by 10.140.101.118 with SMTP id t109mr13858504qge.101.1410867303564; Tue, 16 Sep 2014 04:35:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.165.144 with HTTP; Tue, 16 Sep 2014 04:34:43 -0700 (PDT) In-Reply-To: References: From: Ashish Agarwal Date: Tue, 16 Sep 2014 07:34:43 -0400 Message-ID: To: Caml List Content-Type: multipart/alternative; boundary=001a11c16afc744b8905032d24b4 Subject: Re: [Caml-list] type printing error --001a11c16afc744b8905032d24b4 Content-Type: text/plain; charset=UTF-8 To add info, I'm getting this error in the context of a larger program with ocamlc, so it is not a utop specific issue. Unfortunately, I still can't produce it in this smaller example outside of utop. On Mon, Sep 15, 2014 at 11:20 AM, Ashish Agarwal wrote: > The following example leads to an assertion from printtyp.ml when loaded > in utop. I made the example as small as I could, but unfortunately it > still depends on a package called Future which in turn depends on Core. > > To run it you'll have to do: > > $ opam pin add future https://github.com/agarwal/future > Then hit Y to install the package. > > $ cat tmp.ml > open Future_std > let f items = > Pipe.peek_deferred items >>= function > | `Comment _ -> return () > > > #require "future.std";; > > # #use "tmp.ml";; > Fatal error: exception "Assert_failure typing/printtyp.ml:583:12" > Raised at file "bytes.ml", line 220, characters 25-34 > > > Doing the equivalent in the standard ocaml toploop or compiling with > ocamlc/ocamlopt doesn't exhibit this assertion. You correctly get the real > error reported: > > $ ocamlfind ocamlc -package future.std -thread tmp.ml > File "tmp.ml", line 5, characters 4-14: > Error: This pattern matches values of type [? `Comment of 'a ] > but a pattern was expected which matches values of type > ('b Future_std.Deferred.t as 'b) Future_std.Deferred.t > The second variant type does not allow tag(s) `Comment > > > The assertion is also avoided if you replace `open Future_std` with a > copy/paste of the relevant part of Future_std. > > --001a11c16afc744b8905032d24b4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
To add info, I'm getting this error in the context of = a larger program with ocamlc, so it is not a utop specific issue. Unfortuna= tely, I still can't produce it in this smaller example outside of utop.=

On Mon, Sep= 15, 2014 at 11:20 AM, Ashish Agarwal <agarwal1975@gmail.com> wrote:
The followi= ng example leads to an assertion from printtyp.ml when loaded in utop. =C2=A0I made the example a= s small as I could, but unfortunately it still depends on a package called = Future which in turn depends on Core.

To run it you'= ll have to do:

Then hit Y to install the package.

$ cat tmp.ml=C2=A0
open Future_std
let f items =3D
=C2=A0 Pipe.peek_deferred items >>=3D function
=C2=A0 | `C= omment _ -> return ()


#require &= quot;future.std";;

# #use "tmp.ml";;
Fatal error: ex= ception "Assert_failure typing/printtyp.ml:583:12"
Rais= ed at file "bytes.ml= ", line 220, characters 25-34 =C2=A0

Doing the equivalent in the standard ocaml toploop or compilin= g with ocamlc/ocamlopt doesn't exhibit this assertion. You correctly ge= t the real error reported:

$ ocamlfind ocamlc= -package future.std -thread tm= p.ml=C2=A0
File "tmp.ml", line 5, characters 4-14:
Error: This patte= rn matches values of type [? `Comment of 'a ]
=C2=A0 =C2=A0 = =C2=A0 =C2=A0but a pattern was expected which matches values of type
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0('b Future_std.Deferred.t as '= ;b) Future_std.Deferred.t
=C2=A0 =C2=A0 =C2=A0 =C2=A0The second v= ariant type does not allow tag(s) `Comment

<= br>
The assertion is also avoided if you replace `open Future_std= ` with a copy/paste of the relevant part of Future_std.


--001a11c16afc744b8905032d24b4--