|
Are you sure those are definition errors:
@Produces Bar<Foo<?>> wildcardFooBarProducerField;
|
@Produces Bar<Foo<?>> produceWildcardFooBar() { ... }
|
?
Is this conclusion based on - CDI 1.1 - 2.2.1 Legal bean types? (http://docs.jboss.org/cdi/spec/1.1/cdi-spec.html#legal_bean_types It say "A parameterized type that contains a wildcard type parameter is not a legal bean type.". But it doesn't say that that wildcards are disallowed on deeper levels of parameterized type parameters.
It see it as analogy to:
//Illegal java type.
|
MyList extends List<?> {
|
//...
|
}
|
|
// Legal java type
|
@ApplicationScoped //Also legal bean type
|
MyList extends List<Optional<?>> {
|
//...
|
}
|
|