caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] classes and labels
@ 2001-03-20 15:02 wester
  2001-03-20 22:11 ` Gerd Stolpmann
  2001-03-21  0:06 ` Jacques Garrigue
  0 siblings, 2 replies; 3+ messages in thread
From: wester @ 2001-03-20 15:02 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-03-22  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-20 15:02 [Caml-list] classes and labels wester
2001-03-20 22:11 ` Gerd Stolpmann
2001-03-21  0:06 ` Jacques Garrigue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).