From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 6C406BBAF for ; Wed, 8 Apr 2009 09:36:18 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8DAIPw20nVpUAUaGdsb2JhbACWHg0LAwcHEQO2TYN7Bg X-IronPort-AV: E=Sophos;i="4.39,343,1235948400"; d="scan'208";a="24180585" Received: from mail.gmx.net ([213.165.64.20]) by mail2-smtp-roc.national.inria.fr with SMTP; 08 Apr 2009 09:36:18 +0200 Received: (qmail invoked by alias); 08 Apr 2009 07:36:17 -0000 Received: from F4526.f.ppp-pool.de (EHLO [10.123.101.36]) [195.4.69.38] by mail.gmx.net (mp038) with SMTP; 08 Apr 2009 09:36:17 +0200 X-Authenticated: #20477425 X-Provags-ID: V01U2FsdGVkX18d7pgcRH0dKu7twT53cIHj+czooBQXkQgRvX8K2w M/BLXQ9p9Yn3By From: Michael To: caml-list@yquem.inria.fr Subject: storing object in record Date: Wed, 8 Apr 2009 09:36:16 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904080936.16263.micha-1@fantasymail.de> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.67 X-Spam: no; 0.00; mutable:01 mutable:01 cheers:01 unbound:01 rec:01 rec:01 inherit:01 parameter:02 seems:03 let:03 missing:07 michael:07 michael:07 storing:08 i'm:09 it seems that I'm not able to figure out how to do this: class baseclass = object(this) method asBase = (this :> baseclass) (* ... *) end;; class ex = object inherit baseclass method name = "ex" end type state_rec = { mutable state: 'a. #baseclass as 'a };; this gives an error: let x = new ex;; { state = x };; Error: This field value has type ex which is less general than 'a. #baseclass as 'a or: { state = x#asBase };; Error: This field value has type baseclass which is less general than 'a. #baseclass as 'a or: type state_rec = { mutable state: 'a. < asBase: baseclass;..> as 'a };; gives: Error: Unbound type parameter .. what I'm missing here? cheers Michael