From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA02718; Tue, 9 Sep 2003 09:16:10 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 JAA04194 for ; Tue, 9 Sep 2003 09:16:09 +0200 (MET DST) Received: from mail1.telekom.de (mail1.telekom.de [62.225.183.202]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h897G8T24950 for ; Tue, 9 Sep 2003 09:16:09 +0200 (MET DST) Received: from g9jbr.mgb01.telekom.de by G8SBV.dmz.telekom.de with ESMTP for caml-list@inria.fr; Tue, 9 Sep 2003 09:15:41 +0200 Received: by G9JBR.mgb01.telekom.de with Internet Mail Service (5.5.2653.19) id ; Tue, 9 Sep 2003 09:15:41 +0200 Message-Id: From: "Beck01, Wolfgang" To: caml-list@inria.fr Subject: [Caml-list] strange behaviour with variants and "cannot be generalized" Date: Tue, 9 Sep 2003 09:15:40 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Loop: caml-list@inria.fr X-Spam: no; 0.00; t-systems:01 struct:01 compiles:01 3.06.:01 arrays:01 variants:01 int:01 int:01 behaviour:01 behaviour:01 wolfgang:02 wolfgang:02 string:03 explanation:04 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I have three files vtop.ml -------------------------- type 'a t = { t_c : 'a; } v1.ml ---------------------------- open Vtop type t = { v1_x : int array; } let init = `V1 { v1_x = [| 0 |] } v2.ml ---------------------------- open Vtop type t= { v2_x : int; } let init = `V2 { v2_x = 0 } --------------------------------- compilation fails with "The type of this expression _[> `V1 of t ] Vtop.t, contains type variables that cannot be generalized" However, if I change the type of v1_x to a string or some large struct, it compiles without warning and works. The error seems only to occur with arrays. I am using version 3.06. Is there an explanation for this behaviour? Wolfgang Beck ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners