Hello list,
I went to recompile some software I wrote, after installing OCaml
3.11.0, and it won't compile. Specifically the following code snippet
compiles in OCaml 3.09.3:
class virtual c1 = object(self)
end
class virtual c2 = object(self)
inherit c1
method virtual stuff: c2 list
method contents: c1 list =
(self#stuff :> c1 list)
method size: int =
List.fold_right (fun (c:c2) sum ->
(c#size) + sum) (self#stuff) 0
end
Yet in 3.11.0, the compiler complains:
File "test.ml", line 14, characters 10-11:
Error: This expression has type c2
It has no method size
The expression in question is the variable `c' in the expression
`c#size'. Note that removing the method `contents', which is not used
anywhere, or having `contents' just return [], causes it to compile
without error.
Any thoughts?
Thanks,
~Brighten Godfrey
_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-listArchives:
http://caml.inria.frBeginner's list:
http://groups.yahoo.com/group/ocaml_beginnersBug reports:
http://caml.inria.fr/bin/caml-bugs