|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
The following snippet compiles with javac7, but not javac8-b128.
===
class Test {
class T<E> {}
abstract class One<E> {
abstract E foo();
}
abstract class Two<T> extends One<T> {
abstract T foo();
}
}
===
error: foo() in Test.Two cannot override foo() in Test.One
abstract T foo();
^
return type T is not compatible with Test.T
where T,E are type-variables:
T extends Object declared in class Test.Two
E extends Object declared in class Test.One
Type parameter T should be shadowing the inner class Test.T
reported in compiler-dev: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-February/008515.html
|