From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA17589 for caml-redistribution; Mon, 6 Sep 1999 10:26:24 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA01297 for ; Sat, 4 Sep 1999 17:50:21 +0200 (MET DST) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id RAA15882 for ; Sat, 4 Sep 1999 17:50:20 +0200 (MET DST) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id RAA18090 for caml-list@inria.fr; Sat, 4 Sep 1999 17:50:19 +0200 (MET DST) From: Markus Mottl Message-Id: <199909041550.RAA18090@miss.wu-wien.ac.at> Subject: typing, records and "with" To: caml-list@inria.fr (OCAML) Date: Sat, 4 Sep 1999 17:50:19 +0100 (MET DST) X-Mailer: ELM [version 2.4 PL21] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: weis Hello, it seems that the inferred type in combination with the "with" construct (records) could sometimes be more general. Eg.: type 'a t = {a : 'a; b : int} let x = {a = 1; b = 2} let y = {x with a = "1"} This leads to the following error: File "bla.ml", line 4, characters 9-10: This expression has type int t but is here used with type string t But everything is fine with the following binding of y: let y = {a = "1"; b = x.b} Maybe 'a shouldn't be bound to the type parameter of the "source record" within the "with" construct, but checked only against the "general" type for consistency - this would find errors as in: type 'a t = {a : 'a; b : 'a} let x = {a = 1; b = 2} let y = {x with a = "1"} Regards, Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl