Status: Open (View Workflow)
Affects Version/s: 1.2.Final
Fix Version/s: None
Rules defined in section '5.2.4. Assignability of raw and parameterized types' do not consider the case when a type variable has multiple bounds.
For example, the bullet
the required type parameter and the bean type parameter are both type variables and the upper bound of the required type parameter is assignable to the upper bound, if any, of the bean type parameter.
should have meaning similar to:
... for each upper bound T of the bean type parameter, there is an (at least one) upper bound of the required type which is assignable to T.
Consider the following example:
- interfaces Bar, Baz, Foo
- injection point:
MyBean should not be assignable to this IP as U does not have the bound Foo. However, if e.g. BarImpl implemented also Foo, it should be OK, i.e. MyBean could be injected.
Please, correct me if I am wrong.