From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9736FBB9C for ; Mon, 19 Sep 2005 14:07:58 +0200 (CEST) Received: from mxintern.schlund.de (mxintern.kundenserver.de [212.227.126.201]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8JC7wfl005727 for ; Mon, 19 Sep 2005 14:07:58 +0200 Received: from [172.17.36.11] (helo=schluck.use.schlund.de) by mxintern.kundenserver.de with esmtp (Exim 4.34) id 1EHKRB-0006we-Th for caml-list@yquem.inria.fr; Mon, 19 Sep 2005 14:07:58 +0200 From: Michael Wohlwend To: caml-list Subject: ocamlc throws exception Date: Mon, 19 Sep 2005 14:07:57 +0200 User-Agent: KMail/1.8 X-Face: S)[vu%Bha1d&ej9GfwAq~7C}A,y[B.uS}+D6'hb~xPwsxymw$fnCOaMe<=?utf-8?q?*bnUajSBR=5Fm=3FR=0A=09?=@V3;iX8[A}z`.%pEQ1r7iZhN8#ktTCBQ}&mkx>=RH&l|l6\]NZI@ MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509191407.57650.micha-1@fantasymail.de> X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Miltered: at nez-perce with ID 432EAA1E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocamlc:01 val:01 mutable:01 ctype:01 unify:01 stack:01 backtrace:01 ...:98 node:01 node:01 exception:01 exception:01 inherit:01 expression:01 compiles:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO,SPF_FAIL autolearn=disabled version=3.0.3 that code : ----------------------------------------------- class ['a] nil = object(self:'a) method next = self method set_next n = () method apply (f:'a -> unit) (upto:'a) = () end;; class ['a] node = object(self:'a) constraint 'a = 'a #nil (* line 10 *) inherit ['a] nil val mutable next = new nil method set_next n = next <- n method apply f upto = f self; if self <> upto then self#next#apply f upto end;; let a = new node;; ----------------------------------------- causes this exception: Fatal error: exception Ctype.Unify(_, 0) (Program not linked with -g, cannot print stack backtrace) without line 10 it compiles, allthough I get this error-message: The type of this expression, < apply : ('a -> unit) -> 'a -> unit; next : 'a; set_next : (< apply : ('b -> unit) -> 'b -> unit; next : 'b; set_next : '_c -> unit > as 'b) -> unit > as 'a, contains type variables that cannot be generalized is the exception o.k. ? I know now that the contstraint statement is wrong and sensless here... Michael