-
Bug
-
Resolution: Fixed
-
P2
-
8
-
b39
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085448 | emb-9 | Unassigned | P2 | Resolved | Fixed | team |
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
===
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
- backported by
-
JDK-8085448 javac, incorrect shadowing of classes vs type parameters
- Resolved
- duplicates
-
JDK-8055769 Type variable incorrectly resolved to class in a different scope
- Closed
-
JDK-8149008 Incorrect substitution of type parameter in generic superclass
- Closed
-
JDK-8184232 Generic type definition token not prioritised over class symbols
- Closed
- relates to
-
JDK-7118412 Shadowing of type-variables vs. member types
- Closed