Ocaml 3.09.3 --> 3.11.0 breaks this

View: New views
3 Messages — Rating Filter:   Alert me  

Ocaml 3.09.3 --> 3.11.0 breaks this

by Brighten Godfrey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Re: Ocaml 3.09.3 --> 3.11.0 breaks this

by Stéphane Glondu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brighten Godfrey a écrit :
> 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: [...]

Your code works with OCaml 3.11.1. Maybe it was a temporary regression.


Best regards,

--
Stéphane

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Re: Ocaml 3.09.3 --> 3.11.0 breaks this

by Brighten Godfrey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 27, 2009, at 4:45 AM, Stéphane Glondu wrote:
> Brighten Godfrey a écrit :
>> 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: [...]
>
> Your code works with OCaml 3.11.1. Maybe it was a temporary  
> regression.


Yes, it seems to work again in 3.11.1.  Thanks!

~Brighten

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs