Here I tried to replace the HashMap<Foo, List<String>> with a HashMap<Foo, List<Integer>> and it compiles without any problem while it should complain that the 2 types are incompatible. Of course, I understand this is due to generics erasure and probably there's nothing we can do about this. Anyway it is something that has to be considered before to decide if we want to introduce this feature: I am afraid that generics erasure could also cause other inconsistencies that I am not able to see at the moment.