Anonymous | Login | Signup for a new account | 2019-02-20 02:54 CET | ![]() |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||
0005821 | OCaml | typing | public | 2012-11-13 20:07 | 2015-12-11 19:08 | |||
Reporter | Martin Jambon | |||||||
Assigned To | frisch | |||||||
Priority | normal | Severity | minor | Reproducibility | always | |||
Status | closed | Resolution | fixed | |||||
Platform | OS | OS Version | ||||||
Product Version | 4.00.1 | |||||||
Target Version | Fixed in Version | 4.01.0+dev | ||||||
Summary | 0005821: Wrong record field is reported as duplicate | |||||||
Description | When a record field in an expression is defined twice by mistake, the error message reports another field as duplicated. It is confusing and can take a long time to figure out when the record has many fields (we routinely use records of more than 20 fields). The problem exists with ocaml 4.00.0 and 4.00.1. Not sure when it started. Here are some examples where the wrong field is reported: OCaml version 4.00.1 type t = { a : int; b : int; c : int };; # type t = { a : int; b : int; c : int; } # let a, b, c = 1, 2, 3;; val a : int = 1 val b : int = 2 val c : int = 3 # let x = { a = 1; b; c = 3; b = 4 };; Characters 8-34: let x = { a = 1; b; c = 3; b = 4 };; ^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: The record field label c is defined several times # let y = { a = 1; b; c; b = 4 };; Characters 8-30: let y = { a = 1; b; c; b = 4 };; ^^^^^^^^^^^^^^^^^^^^^^ Error: The record field label c is defined several times # let z = { a; b; c; b };; Characters 8-22: let z = { a; b; c; b };; ^^^^^^^^^^^^^^ Error: The record field label c is defined several times # let t = { a = 0; b = 0; c = 0; b = 0 };; Characters 8-38: let t = { a = 0; b = 0; c = 0; b = 0 };; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error: The record field label c is defined several times The reported field seems to be off by one, as shown in this longer example: type long = { a : int; b : int; c : int; d : int; e : int; f : int; g : int; h : int; i : int; j : int; } ;; let x = { a = 0; b = 0; c = 0; d = 0; e = 0; f = 0; g = 0; h = 0; i = 0; e = 0; j = 0; } ;; Error: The record field label f is defined several times | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||
|
![]() |
|
(0008512) frisch (developer) 2012-11-14 18:00 |
Thanks! This is now fixed in trunk (commit 13093). |
![]() |
|||
Date Modified | Username | Field | Change |
2012-11-13 20:07 | Martin Jambon | New Issue | |
2012-11-14 17:51 | frisch | Assigned To | => frisch |
2012-11-14 17:51 | frisch | Status | new => assigned |
2012-11-14 18:00 | frisch | Note Added: 0008512 | |
2012-11-14 18:01 | frisch | Status | assigned => resolved |
2012-11-14 18:01 | frisch | Fixed in Version | => 4.01.0+dev |
2012-11-14 18:01 | frisch | Resolution | open => fixed |
2013-02-22 10:02 | frisch | Relationship added | has duplicate 0005929 |
2015-12-11 19:08 | xleroy | Status | resolved => closed |
2017-02-23 16:45 | doligez | Category | OCaml typing => typing |
Copyright © 2000 - 2011 MantisBT Group |