Generics name clash
-
12-11-2019 - |
Question
Consider:
public interface Foo<T> {
public static class X{}
public void foobar(T t);
}
public class Bar<X> {
Foo<X> foo = new Foo<X>() {
public void foobar(X t) {}
};
}
I found no way to express that I mean the X
from Bar<X>
and not Foo.X
in the foobar(X t)
implementation. Is there no other way than renaming the generic parameter X
in Bar
or the static inner class?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow