Regression in the javac 1.8u40
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Tue Apr 21 14:22:25 UTC 2015
FYI,
with the help of Aaron, we've been able to identify the problem - I've
filed this:
https://bugs.openjdk.java.net/browse/JDK-8078249
Maurizio
On 20/04/15 17:13, Maurizio Cimadamore wrote:
> Hi Aaron,
> the following program seems to compile for me - what am I missing?
>
>
> interface Bar<B extends Bar<B>> {
> <T extends Bar<T>> T foo();
> }
>
> class A implements Bar<A> {
> @Override
> public <T extends Bar<T>> T foo() {
> return null;
> }
> }
>
> class B extends A {
> @Override
> public <T extends Bar<T>> T foo() {
> T result = super.foo();
> return result;
> }
> }
>
>
> Maurizio
>
> On 20/04/15 17:03, Rob McKenna wrote:
>> <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;
>> }
>
More information about the compiler-dev
mailing list