Note that even if we relax the check it will not be always possible to resolve all the type variables in the runtime type, i.e. the subsequent fire() invocation might fail. E.g. the following snippet would result in IllegalArgumentException:
@Inject
|
Event<Object> event;
|
public void testSelectSubtypeWithWildcard() {
|
List<String> updatedList = new ArrayList<>();
|
updatedList.add("foo");
|
// This is ok
|
Event<List<?>> child = event.select(new TypeLiteral<List<?>>() {});
|
// This will fail
|
child.fire(updatedList);
|
}
|
I'm not so sure this should be fixed anymore.
|