Java nested generic type mismatch

If you want to be able to call fourth with a List<List<String>> argument, then you’ll need to change your signature to this: private static void fourth(List<? extends List<?>> a){ System.out.println(“List of a List of anything “); } The above will work because unlike List<List<?>>, List<? extends List<?>> is compatible with List<List<String>>. Think of it this … Read more

Higher-order type functions in TypeScript?

You’re correct, it’s not currently representable in TypeScript. There’s a longstanding open GitHub feature request, microsoft/TypeScript#1213, which should probably be titled something like “support higher kinded types” but currently has the title “Allow classes to be parametric in other parametric classes”. There are some ideas in the discussion about how to simulate such higher kinded … Read more