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 F3FF27F30A for ; Sun, 10 Mar 2013 00:39:58 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yminsky@gmail.com) identity=pra; client-ip=74.125.82.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@gmail.com"; x-sender="yminsky@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yminsky@gmail.com designates 74.125.82.47 as permitted sender) identity=mailfrom; client-ip=74.125.82.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@gmail.com"; x-sender="yminsky@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wg0-f47.google.com) identity=helo; client-ip=74.125.82.47; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@gmail.com"; x-sender="postmaster@mail-wg0-f47.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkUCAPrHO1FKfVIviGdsb2JhbABDxjYIFg4BAQEKCRQUBCSCPiAVARseAxIQXQEMAQQBBQEDAYgxAQECD5tGgnKDaIhKCYJyg3wKGQQKGQ1ZiHwBBQyPH4MqA4hyjWOBHoVdiBgWKUSEBx4 X-IPAS-Result: AkUCAPrHO1FKfVIviGdsb2JhbABDxjYIFg4BAQEKCRQUBCSCPiAVARseAxIQXQEMAQQBBQEDAYgxAQECD5tGgnKDaIhKCYJyg3wKGQQKGQ1ZiHwBBQyPH4MqA4hyjWOBHoVdiBgWKUSEBx4 X-IronPort-AV: E=Sophos;i="4.84,814,1355094000"; d="scan'208";a="4788843" Received: from mail-wg0-f47.google.com ([74.125.82.47]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Mar 2013 00:39:57 +0100 Received: by mail-wg0-f47.google.com with SMTP id dr13so3698378wgb.2 for ; Sat, 09 Mar 2013 15:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:date:message-id:subject:from:to :content-type; bh=rPiTMRlJudSMAFatgDFVT7BGz7pr3fbK/UX9asIjzmA=; b=k5ZLtqgwY5lH4fy+Pd4sfbqdrSemwE4TTS+YjnJNfHoL/33Zql89fMDY3MPlrIQxKe SsvLa2e6/lMgMfZtjQguObLV+if3DTx7g+j11hSvfzvb9m9uwI99FJSChD0HP4JFJGl3 Ex0dbf95LiQaqheVJ83m6dft7ZjLJ5mVAdYG4pnh1NRDgjSOCnTXTKIedTG511KdmDLk qi6lWlB5wwEk8QGSUzOYQt/e39iyKppDvMcm8+/USrTKQZQHliaX7VtDvhezjiwOmRXf zutG67UhJ+MqmbaquYBj6GCpUCSBHVMXuBYdeHtMw6CJwfKFdwz35JDja4H+42uAuklv XbhA== MIME-Version: 1.0 X-Received: by 10.180.93.168 with SMTP id cv8mr5417679wib.5.1362872396731; Sat, 09 Mar 2013 15:39:56 -0800 (PST) Received: by 10.194.122.168 with HTTP; Sat, 9 Mar 2013 15:39:56 -0800 (PST) Reply-To: yminsky@gmail.com Date: Sat, 9 Mar 2013 18:39:56 -0500 Message-ID: From: Yaron Minsky To: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: [Caml-list] Record field disambiguation in 4.01 This is all in the vein of complaining about a feature that has not yet been released, so, apologies if all of this is already known and plans are there for fixing it. I've been playing around with a recent 4.01 snapshot of the compiler in OPAM, and have run against an interesting issue with the record field disambiguation. In particular, I have some code that looks roughly like this: open Core.Std type posn = { x: float; y: float } let cross_product p1 p2 = p1.x *. p2.y -. p1.y *. p2.x ;; And when I try to compile this, I get the following error: File "geometry.ml", line 68, characters 13-14: Warning 41: this use of y is ambiguous. File "geometry.ml", line 1: Error: Error-enabled warnings (1 occurrences) Command exited with code 2. This can be fixed by adding an annotation: let cross_product p1 (p2:posn) = p1.x *. p2.y -. p1.y *. p2.x ;; A few concerns: one, it's really hard to figure out where the source of the conflict is from this message. It would be nice to get some clue from the compiler as to the two definitions that are conflicting. 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. y