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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id C116C80043 for ; Tue, 18 Oct 2016 15:52:56 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=andre@digirati.com.br; spf=Pass smtp.mailfrom=andre@digirati.com.br; spf=Pass smtp.helo=postmaster@mta123.f1.k8.com.br Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of andre@digirati.com.br) identity=pra; client-ip=187.73.32.199; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="andre@digirati.com.br"; x-sender="andre@digirati.com.br"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of andre@digirati.com.br designates 187.73.32.199 as permitted sender) identity=mailfrom; client-ip=187.73.32.199; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="andre@digirati.com.br"; x-sender="andre@digirati.com.br"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@mta123.f1.k8.com.br designates 187.73.32.199 as permitted sender) identity=helo; client-ip=187.73.32.199; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="andre@digirati.com.br"; x-sender="postmaster@mta123.f1.k8.com.br"; x-conformance=sidf_compatible; x-record-type="v=spf1" IronPort-PHdr: =?us-ascii?q?9a23=3AcdtVqh/DLd3Vtf9uRHKM819IXTAuvvDOBiVQ1KB9?= =?us-ascii?q?0OgcTK2v8tzYMVDF4r011RmSDN+dtq4P1bSempujcFRI2YyGvnEGfc4EfD4+ou?= =?us-ascii?q?JSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47AblHf6ke/8SQVUk2mc1Ek?= =?us-ascii?q?fKKoRsWM0Yye7KObw9XreQJGhT6wM/tZDS6dikHvjPQQmpZoMa0ryxHE8TNicu?= =?us-ascii?q?VSwn50dxrIx06vrpT4wJk2+C1Vv7cl9tVceaT8ZaUxC7JCXxo8NGVgzcvnrxSL?= =?us-ascii?q?awKT5nIaGjEflBZSDiDJ7R77RJ7ts23xse870jPMbp6+dqw9RTn3t/QjcxTvki?= =?us-ascii?q?pSbzM=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0ChAACTKAZYh8cgSbtcHhgNBQEXAQYBg?= =?us-ascii?q?wQBAQEBAYEeUqQ5lDiCCIYiAoF+OBQBAQEBAQEBAQEBARIBAQEKCwkJGS+CMhi?= =?us-ascii?q?CGAEBBCMdAQE4DwsYKgICIAsCASkTCAEBiFC1EWeESQEBBYg5BgmIOgiCUIQYe?= =?us-ascii?q?4IACy2CW5oLg0CBeIpmTYhwEoEBhQuMe4N+Ah56BgiDD4F2WohWAQEB?= X-IPAS-Result: =?us-ascii?q?A0ChAACTKAZYh8cgSbtcHhgNBQEXAQYBgwQBAQEBAYEeUqQ?= =?us-ascii?q?5lDiCCIYiAoF+OBQBAQEBAQEBAQEBARIBAQEKCwkJGS+CMhiCGAEBBCMdAQE4D?= =?us-ascii?q?wsYKgICIAsCASkTCAEBiFC1EWeESQEBBYg5BgmIOgiCUIQYe4IACy2CW5oLg0C?= =?us-ascii?q?BeIpmTYhwEoEBhQuMe4N+Ah56BgiDD4F2WohWAQEB?= X-IronPort-AV: E=Sophos;i="5.31,362,1473112800"; d="asc'?scan'208";a="197234274" Received: from mta123.f1.k8.com.br ([187.73.32.199]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2016 15:52:54 +0200 Received: from localhost (localhost [127.0.0.1]) by smtpz.f1.k8.com.br (Postfix) with ESMTP id AAA7B600BE for ; Tue, 18 Oct 2016 13:52:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at k8.com.br Received: from smtpz.f1.k8.com.br ([127.0.0.1]) by localhost (mta123.f1.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sgrWWsfwYj79 for ; Tue, 18 Oct 2016 13:52:46 +0000 (UTC) Received: from [10.200.12.21] (unknown [201.76.188.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtpz.f1.k8.com.br (Postfix) with ESMTPSA id 4246660187 for ; Tue, 18 Oct 2016 13:52:44 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.6.8 smtpz.f1.k8.com.br 4246660187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digirati.com.br; s=default; t=1476798764; bh=w3tjjKNwwBp3p5PZ0DGZEF39/9K6ZKy9NxJq9zdeOFY=; h=Subject:To:References:From:Date:In-Reply-To; b=HHt+xXRlpi5yF5/Rm1gZ9AQhs63oNjFgIoDQKZ3iKt9YV+wLAKh0ZVMJ7ksNRpTLD L39aSrrVC4ybdTiQy/xTD9KNWVlV5k66U2Cd9qyBqMqZPBXPzmXs4N1wqbtWJ6lkXf mnT/G1HnFbltZqroVTyfrmz4WM4hwedCORco+GK4= To: caml-list@inria.fr References: From: Andre Nathan Message-ID: Date: Tue, 18 Oct 2016 11:52:40 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dejeAvd2t4BUftFHpfSfm402mDn4UtD0V" Subject: Re: [Caml-list] Segfault with open GADTs This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dejeAvd2t4BUftFHpfSfm402mDn4UtD0V Content-Type: multipart/mixed; boundary="eXL0qchhtnxdLaminxPlpjOhDw5IQQ5aB"; protected-headers="v1" From: Andre Nathan To: caml-list@inria.fr Message-ID: Subject: Re: [Caml-list] Segfault with open GADTs References: In-Reply-To: --eXL0qchhtnxdLaminxPlpjOhDw5IQQ5aB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/18/2016 11:10 AM, Pierrick Couderc wrote: > Hi, >=20 > It is supposed to work, but it seems thepattern-matching compiler does > not detect that M0.to_string is non exhaustive, thus it does not add a > Match_Failure in case the variant is unknown. With extensible variants, > a pattern matching is only exhaustive if you provide a wildcard or a > variable for variants added afterwards.=20 Indeed, if I add a catch-all branch in M0.to_string then the code in that branch is run, with no segfault. But I guess my original idea of extending the type doesn't really work as I hoped, since with nested expressions like that, I'd need to find a way for M0.to_string to call back M1.to_string when a `T` is found. Back to the drawing board... Thanks, Andre --eXL0qchhtnxdLaminxPlpjOhDw5IQQ5aB-- --dejeAvd2t4BUftFHpfSfm402mDn4UtD0V Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJYBikoAAoJED4JW1qwFY2ce0MIAK6ZdfP3ryELwAFKTrFsz3tL vIc36yUhDK1PdP46axXW/ZPLiGorxQWNcJjKpwmqAcJr6zPvPtd0JKZ6ePSo38ID B66sIPuBbUuQUJ1/pdCk687t7zaS+eK+wYNCNEVR30vfokRf0Sf/bzwLqKRkG4Or 8RXx6tpjCAbKElCZRPFCZqXci6MPzjHLTuc3OwcbQ0EzUHjPEJxByua10x8w9hLp e8m9a/31tHeBCSbqApxmb01x7ITS/vatFu5DOxh3yqfk5Xos+3j4TOwbvbmey1LR /b1gM/CyFvcqimH+3iBLeHc5IXgYuqJK8tTCeWo88qb4aZuZYbVal1/BkKEnnGA= =iw5g -----END PGP SIGNATURE----- --dejeAvd2t4BUftFHpfSfm402mDn4UtD0V--