Dear list,
I'm having a little problem understanding constraints in objects. Consider the following code:
class type foo =
object
method get_parent : foo
end
class type foo2 =
object
constraint foo2 = #foo
method baz : float
method get_parent : foo2
end
it gives me the following error:
The abbreviation foo2 expands to type < baz : float; get_parent : foo2 >
but is used with type #foo
but foo2 is clearly a subtype of foo. What am I doing wrong? I'm using ocaml 3.10.2
--Jacques Le Normand