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 E9F077F30A for ; Mon, 11 Mar 2013 12:52:55 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=pra; client-ip=193.252.23.211; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=mailfrom; client-ip=193.252.23.211; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@msa.smtpout.orange.fr) identity=helo; client-ip=193.252.23.211; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="postmaster@msa.smtpout.orange.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvcAAMDEPVHB/BfTiWdsb2JhbABDwXCCYYFtDgEBARUSFAMlgigBAQU4QAEQCxgJFg8JAwIBAgFFEwEHAQGIE7tDjw4HFoMqA5ZVhXqOBg X-IPAS-Result: AvcAAMDEPVHB/BfTiWdsb2JhbABDwXCCYYFtDgEBARUSFAMlgigBAQU4QAEQCxgJFg8JAwIBAgFFEwEHAQGIE7tDjw4HFoMqA5ZVhXqOBg X-IronPort-AV: E=Sophos;i="4.84,822,1355094000"; d="scan'208";a="4918638" Received: from msa02.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.211]) by mail3-smtp-sop.national.inria.fr with ESMTP; 11 Mar 2013 12:52:55 +0100 Received: from [192.168.1.120] ([86.195.25.207]) by mwinf5d60 with ME id ABss1l00S4U5yvJ03Bstlv; Mon, 11 Mar 2013 12:52:54 +0100 Message-ID: <513DC595.9020006@frisch.fr> Date: Mon, 11 Mar 2013 12:52:53 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: yminsky@gmail.com CC: caml-list@inria.fr References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Record field disambiguation in 4.01 On 03/10/2013 12:39 AM, Yaron Minsky wrote: > Also, I'm wondering if anyone has thoughts as to how much code this > change will break? The answer might be "quite a lot", and it might > nonetheless be worth it. But I'm curious what people's thoughts are. As Jacques said, this is only a warning, which is turned off by default. I expect that all the "unused stuff" warnings also broke most code bases around which are compiled with "-w +A -warn-error A". I'm sure you are not suggesting that new warnings should never be triggered on code which used to be well-typed by a previous version of the compiler... The warning tells you something useful: with that record type declaration, the reference to field "y" becomes ambiguous, which means in particular that (i) your code might become fragile w.r.t. reordering of type declarations, (ii) the code might become harder to read (the reader might expect that field "y" is typically related to a different record type in your code base). Of course, a more explicit warning message, as you suggest, would be even better. During the discussion on type-based disambiguation, Mark Shinwell commented that most record types in JS code base are defined in nested modules (and often exposed only through builder functions) to avoid label clashes. Is your example an instance where this is not the case? Alain