Annotations on lambda parameters and captured outer locals.

Srikanth srikanth.adayapalam at oracle.com
Thu Dec 3 05:28:28 UTC 2015


Hello !

The prose in the description of JDK-8138729 read in conjunction with
JDK-8140279 would seem to require that

     - Declaration and type annotations from the captured outer locals 
of a lambda
       expression are not to be transmitted to the formal parameter 
(that represents/reifies
       the captured local variable) of the synthetic lambda 
implementation method[*]

     - Declaration annotations on a lambda formal should not make it to the
       class file at all.

     - Type annotations on the type of a lambda formal should be carried 
over to the type
       of the formal parameter of the synthetic method that implements 
the lambda[*]

Is this correct ?

I have no problems implementing this, but it does read a bit irregular. 
A confirmation that
this is all reasoned out and intentional would help.

[*]  if that is the translation strategy/tactic chosen by a compiler.

Thanks in advance,
Srikanth


More information about the compiler-dev mailing list