Regression in the javac 1.8u40

Aaron Digulla digulla at hepe.com
Mon Apr 20 15:33:45 UTC 2015


Hello,

I've found a regression in generics handling of Java 8. The code can be compiled and works fine with Java 6u45 and 7u75.

Basically, I have an interface with this method:

    <T extends Bar<T>> T foo();

where Bar is

    interface Bar<B extends Bar<B>> {}

I can implement this method without problem
   
    @Override
    public <T extends Bar<T>> T foo() {
       return null;
    }

but I can't override such a method anymore in Java 8:

    @Override
    public <T extends Bar<T>> T foo() {
       T result = super.foo();
       return result;
    }


I've a small project which demonstrates the issue. I tried to open a bug but couldn't create a user in the bug database.

What should I do, now?

Regards,

-- 
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits." 
http://blog.pdark.de/


More information about the jdk8u-dev mailing list