Lambda translation

Brian Goetz brian.goetz at oracle.com
Sun Apr 22 16:12:08 PDT 2012


Yes, that bit us during the implementation of the metafactory.  By using 
the method handle of the SAM method to describe the SAM, there is the 
risk that the method will be in the wrong class, such as in:

interface A { void m(); }
interface B extends A { }
B x = () -> { ... })

Here, the method handle that the metafactory receives for describing the 
SAM will be A.m.  But, because the invoked type signature has B as a 
return type for the factory site, we can recover this information from 
the invocation signature and use that.

On 4/22/2012 7:06 PM, Rémi Forax wrote:
> On 04/23/2012 12:31 AM, Brian Goetz wrote:
>>> There is also another problem because classes are checked by their name,
>>> moving an abstract method of an interface into a super-interface will be
>>> no more binary compatible.
>>
>> Can you unpack this assertion a bit?
>
> sorry, my bad.
> Forget that what you encode is the SAM type and not the declaring type
> of the SAM method.
>
> Rémi
>
>
>


More information about the lambda-dev mailing list