ATM (and since forever) Weld has been rejecting injection of any Event/Instance with wildcard in it.
However, as has been pointed out recently in jakartaee/cdi#888 (comment), this is theoretically incorrect.
I say theoretically, because there is no actual added value in being able to @Inject Event<? super Something> versus just @Inject Event<Something>. You'd still fire the same events from both.
That said, Event is naturally contravariant and should therefore allow ? super X, while Instance is covariant and should allow ? extends Y.
At the same time, we want to keep rejecting all the other variants such as unbound wildcard.
This change should go to Weld 6 and 7 alike.
CDI TCK - jakartaee/cdi-tck#727
CDI - jakartaee/cdi#982
ATM (and since forever) Weld has been rejecting injection of any
Event/Instancewith wildcard in it.However, as has been pointed out recently in jakartaee/cdi#888 (comment), this is theoretically incorrect.
I say theoretically, because there is no actual added value in being able to
@Inject Event<? super Something>versus just@Inject Event<Something>. You'd still fire the same events from both.That said,
Eventis naturally contravariant and should therefore allow? super X, whileInstanceis covariant and should allow? extends Y.At the same time, we want to keep rejecting all the other variants such as unbound wildcard.
This change should go to Weld 6 and 7 alike.
CDI TCK - jakartaee/cdi-tck#727
CDI - jakartaee/cdi#982