Browse thread
[Caml-list] Problem with parametric classes
-
Frederic Tronel
- Sami Mäkelä
- John Max Skaller
[
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: | John Max Skaller <skaller@o...> |
| Subject: | Re: [Caml-list] Problem with parametric classes |
Frederic Tronel wrote: >Hello, > >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: > I commented out the initialiser in specElement and got this error: File "tmp.ml", line 30, characters 22-41: The type of this expression, < get_ident : int; set_ident : int -> unit; _.. > countingObjects, contains type variables that cannot be generalized and here on line 30 you are making an instance object without binding the type variable .. let countingObjects = new countingObjects ;; That seems suspicious .. countingObjects is generic here .. this is at global scope .. the initialiser which fixes the type is inside a class .. this has to be wrong .. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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