Closure conversion vs inherited and redeclared method

Mark Mahieu mark at twistedbanana.demon.co.uk
Thu May 15 14:57:56 PDT 2008


Closure conversion doesn't seem to work correctly when the target  
interface type inherits its single method and redeclares it:


public class Redeclared {

     interface Foo1 {
         void foo();
     }

     interface Foo2 extends Foo1 {
         void foo();
     }

     public static void main(String[] args) {
         Foo1 foo1 = {=>};
         Foo2 foo2 = {=>};
     }
}



Redeclared.java:13: incompatible types
found   : { => void}
required: Redeclared.Foo2
         Foo2 foo2 = {=>};
                      ^
1 error



Regards,

Mark




More information about the closures-dev mailing list