Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] classes and labels
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: wester@i...
Subject: [Caml-list] classes and labels
Hi,

I have the class definition:

# class myclass ?(n=0) () =
  object  
   val nn = n;
   method get_nn = nn
   method clone (na: int) = let (mc: myclass) = new myclass ~n:na () in mc;
end;;
 
that produces the following error message in the toplevel:

          Characters 5-153:
The expression "new myclass" has type ?n:int -> unit -> myclass
but is used with type int -> unit -> myclass

Can sombody tell what is wrong with my class definition?
I would be very apprecitative for any help.

With kind regards

Rolf Wester
-------------------------------------
Rolf Wester
wester@ilt.fhg.de
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr