-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8u25
-
x86_64
-
windows_7
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
the code fails to compile
{code}
interface StubElement<T>{
T getPsi();
}
abstract class StubElementBase<T> implements StubElement<T> {
@Override
public T getPsi() {
return null;
}
}
abstract class MyStubbedElement<T extends StubElementBase<?> & Runnable> {}
{code}
error message: Error:(14, 33) java: getPsi() in aa.StubElementBase cannot implement getPsi() in aa.StubElement
return type capture#1 of ? is not compatible with capture#2 of ?
BTW
if we would omit Runnable in type parameter declaration, then the code would compile. Moreover if StubElementBase<T> would be an interface with default method, then the code also would compile.
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try
REGRESSION. Last worked in version 6u43
REPRODUCIBILITY :
This bug can be reproduced always.
A DESCRIPTION OF THE PROBLEM :
the code fails to compile
{code}
interface StubElement<T>{
T getPsi();
}
abstract class StubElementBase<T> implements StubElement<T> {
@Override
public T getPsi() {
return null;
}
}
abstract class MyStubbedElement<T extends StubElementBase<?> & Runnable> {}
{code}
error message: Error:(14, 33) java: getPsi() in aa.StubElementBase cannot implement getPsi() in aa.StubElement
return type capture#1 of ? is not compatible with capture#2 of ?
BTW
if we would omit Runnable in type parameter declaration, then the code would compile. Moreover if StubElementBase<T> would be an interface with default method, then the code also would compile.
THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try
THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try
REGRESSION. Last worked in version 6u43
REPRODUCIBILITY :
This bug can be reproduced always.
- duplicates
-
JDK-8027386 Compiler regression error on multi-level abstract generic class with intersection types
- Open