Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Problem with parametric classes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-04-22 (21:05)
From: John Max Skaller <skaller@o...>
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:
I commented out the initialiser in specElement and got this error:

File "", 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,
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: