-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
21
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The test method fails to compile, as javac believes that getter.get() returns just Object:
class Scratch {
static abstract class Getters<T> {
abstract class Getter {
abstract T get();
}
}
static class Usage<T, G extends Getters<T>> {
public T test(G.Getter getter) {
return getter.get();
}
}
}
FREQUENCY : always
The test method fails to compile, as javac believes that getter.get() returns just Object:
class Scratch {
static abstract class Getters<T> {
abstract class Getter {
abstract T get();
}
}
static class Usage<T, G extends Getters<T>> {
public T test(G.Getter getter) {
return getter.get();
}
}
}
FREQUENCY : always