[weld-dev] Legal bean type question

Matej Novotny manovotn at redhat.com
Thu May 28 05:23:36 EDT 2020


Hmm, I don't know honestly. Might be interesting to bring this up in some CDI list discussion.

Maybe if you imagine any such type with wildcard hidden "deeper inside" as a collection.
So, take something like `List<List<?>>` - you still have no idea what the inner list actually holds.
With this you still don't know if it is a valid bean for IP of type `List<List<Integer>>` or `List<List<String>>`?

Regards
Matej

----- Original Message -----
> From: "Laird Nelson" <ljnelson at gmail.com>
> To: "Matej Novotny" <manovotn at redhat.com>
> Cc: "weld-dev" <weld-dev at lists.jboss.org>
> Sent: Wednesday, May 27, 2020 4:58:13 PM
> Subject: Re: [weld-dev] Legal bean type question
> 
> On Wed, May 27, 2020 at 7:08 AM Matej Novotny <manovotn at redhat.com> wrote:
> 
> > Well, I wasn't there when it was written in stone, but if I were to guess,
> > it's because of bean assignability.
> >
> 
> Right.  I'm less concerned with a bean whose type is, say, List<?>: that
> seems problematic immediately.
> 
> The part I'm having trouble seeing—and it is definitely my problem, I'm
> sure, not the spec's—is something like List<Comparable<?>>.  Which
> assignment scenario is made difficult or impossible if this were
> permitted?  I'm sure there is a reason this is being prohibited; I am just
> slow.  If it's the same case as List<?> then I'm missing why.
> 
> Best,
> Laird
> 



More information about the weld-dev mailing list