I thought I understood this but obviously not...
I have a method signature like so:
void doSomething(List<TypeA> typeAs){...}
List<TypeA<TypeB>> getTypeBTypeAs(){...}
but if I try and call
doSomething(getTypeBTypeAs());
I get a compile error: "the method doSomething(List) in the type ... is not applicable for the arguments (List>)"
however if i change the sig of doSomething
to
void doSomething(List<TypeA<?>> typeAs){...}
it still doesn't work, but
void doSomething(List typeAs){...}
obviously it works as i bypass generics.
which seems odd.
Can someone fill me in?
Also, in this case I'd like doSomething
to work with any List containing TypeAs of any generic type; undefined, TypeB, TypeC etc.
thanks.