Browse thread
[Caml-list] Problem with parametric classes
[
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: | -- (:) |
| From: | Sami Mäkelä <sajuma@u...> |
| Subject: | Re: [Caml-list] Problem with parametric classes |
Frederic Tronel wrote: > I'm using Ocaml 3.04 (plus a patch applied to circumvent a > problem with parametric classes bug id 841). > > I'm trying to compile the following piece of code (more > precisely, this is a significant excerpt of the faulty code). > which fails with the following error: > > File "essai.ml", line 71, characters 5-491: > The abbreviation specElement expands to type > < get_ident : int; get_name : string; mytype : specelement; > recv : string * comm list -> string * string list -> unit; > send : comm -> string -> unit; set_ident : int -> unit; > set_name : string -> unit > > but is used with type < get_ident : int; set_ident : int -> unit; .. > [...] > > What is the problem ??? > It does compile if I comment out send and recv methods of class > specElement. > Any help would be really appreciated. > This is the same problem as "What does this mean?" thread last week. The type of "countingObjects" would become < get_ident : int; get_name : string; mytype : specelement; recv : string * comm list -> string * string list -> unit; send : comm -> string -> unit; set_ident : int -> unit; set_name : string -> unit > countingObjects, but type comm is defined after countingObjects. The solution is to move the definition of countingObjects. ------------------- 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