[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2002-08-23 (15:46) |
From: | Frederic Tronel <Frederic.Tronel@i...> |
Subject: | [Caml-list] Polymorphic methods |
Hello list, I've just compiled the new 3.05 version (I will change for 3.06 tomorrow), and start playing a little bit with polymorphic methods. But this small piece of code does not compile: class node = object val mutable t = None method set_t: 'a. 'a -> unit = fun nt -> t <- Some nt end File "essai.ml", line 4, characters 31-53: This method has type 'a -> unit which is less general than 'b. 'b -> unit while this one is OK (useless). class node = object val mutable t = None method set_t: 'a. 'a -> unit = fun nt -> () end class node : object val mutable t : 'a option method set_t : 'b -> unit end Where am I going wrong ?? Best regards, Frederic. ------------------- 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