The spec allows to infer the parameterized type of the event type from the specified type (e.g. Event injection point). See also
CDI-256
.
public class Bar {
|
|
@Inject
|
private Event<Foo<? extends Number>> event;
|
|
public <T extends Number> void fireWithTypeVariable() {
|
event.fire(new Foo<T>()); // --> this is resolvable
|
}
|
}
|
|