Higher-kinded generics in Java
I think what you’re trying to do is simply not supported by Java generics. The simpler case of public class Foo<T> { public T<String> bar() { return null; } } also does not compile using javac. Since Java does not know at compile-time what T is, it can’t guarantee that T<String> is at all meaningful. … Read more