Primitives in Generics (+ the meaning of this)

Peter Levart peter.levart at
Fri Jul 16 08:28:46 PDT 2010

On 07/09/10, Brian Goetz wrote:
> >> ... some mad professor cooked up :)  :)  :)
> >
> > My take is that you have three choices:
> >    A) Support function types covering primitives
> >    B) Support primitives in generics
> >    C) Do something that doesn't restrict your options to reconsider
> >       (A) or (B) in Java8 in response to all the complaints about
> >       sucky parallel performance.
> Indeed so.  We believe we have chosen (C).  If we have not, please say 
> something!

Hello Brian,

I just have a question regarding C -> A path. It concerns the meaning of explicit and implicit "this" inside lambda body. As proposed in latest lambda -> SAM conversion, "this" refers to the target SAM instance, so does "implicit this" - lambda body "sees" target SAM instance unqualified members first and then other lexicaly surrounding stuff.

What would be the meaning of "this" in the (A) future when lambda expressions are "converted" to a function type?

Would it be the same or different as when converted to a SAM type?

Regardless of that, do you aggree that the statistical evidence, prepared by some members of this list, showed that usage of explicit and implicit "this" inside anonymous inner SAM subclass creation expressions is practically non-existent and is actualy "in the way" of using outer.this and/or outer instance members (even a cause of bugs in JDK itself)?

So why did you choose to treat "this" inside lambda body the way it is specified?

Regards, Peter

More information about the lambda-dev mailing list