latest push

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Oct 28 09:18:01 PDT 2010


This is not a regression. It seems like the prototype has problems 
associated with compilation order; this doesn't work:

class Defaults {
static void foo(Collection o) {}
}

interface Collection {
      public extension void foo() default Defaults.foo;
      public extension void bar() default Defaults.foo;
}

class SetImpl1 implements Set, Collection {}

interface Set extends Collection {
      public extension void foo() default Defaults.foo;
}

while the following does (swapped SetImpl with Set):

class Defaults {
static void foo(Collection o) {}
}

interface Collection {
      public extension void foo() default Defaults.foo;
      public extension void bar() default Defaults.foo;
}

interface Set extends Collection {
      public extension void foo() default Defaults.foo;
}


class SetImpl1 implements Set, Collection {}


Maurizio

On 28/10/10 15:46, Brian Goetz wrote:
> The latest push seems to have resolved the two issues I raised yesterday --
> thanks!
>
> Unfortunately there's also been a regression since yesterday.  Given
>
> public interface Collection {
>       public extension void foo() default Defaults.foo;
>       public extension void bar() default Defaults.foo;
> }
>
> public interface Set extends Collection {
>       public extension void foo() default Defaults.foo;
> }
>
> (both have the same method foo() with the same default).
>
> If I have a class
>
> public class SetImpl implements Set {
> }
>
> everything is fine.  But if I write it like this:
>
> public class SetImpl implements Set, Collection {
> }
>
> I get this error message
>
> test-compile:
>       [javac] Compiling 10 source files to
> /home/brian/work/mangler/trunk/defender/build/test-classes
>       [javac]
> /home/brian/work/mangler/trunk/defender/test/src/foo/SetImpl.java:6: types
> Collection and Set are incompatible; both define foo(), but with unrelated
> default implementations
>       [javac] public class SetImpl implements Set, Collection {
>       [javac]        ^
>       [javac] Note:
> /home/brian/work/mangler/trunk/defender/test/src/junit/DefenderTestCase.java
> uses unchecked or unsafe operations.
>
> This compiled properly under yesterday's build.
>
>
>    



More information about the lambda-dev mailing list