DA/DU changes

Tomasz Kowalczewski tomasz.kowalczewski at gmail.com
Sat Nov 12 09:47:17 PST 2011


Thanks for you response Brian. I wrote that it seems inconsistent _to
me_ as such things will often be very subjective.

-- 
Tomasz Kowalczewski


On Sat, Nov 12, 2011 at 6:33 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> The likelihood is that the adjustments to DA/DU will also apply to inner classes as well. We are evaluating each of the "differences" between lambdas and inner classes, and for each will have to make a decision on which to make "consistent", and there are some that we will definitely not be able to port back (such as the scoping rules for names).  Note that "it seems inconsistent" is something that will be true about Java always, no matter what we do.  But we can try to pick the inconsistencies that make the least un-sense.
>
> On Nov 12, 2011, at 6:11 PM, Tomasz Kowalczewski wrote:
>
>> All,
>>
>> Will the DA/DU changes be applied to anonymous classes (and possibly
>> other places) or will be exclusive to lambda?
>> I was playing with the lambda prototype compiled from hg repo (not the
>> binary snapshot posted by Maurizio). When checking the DA/DU changes
>> made for lambda I did following:
>>
>> // Compiles
>> Runnable run = () -> { run.run(); };
>>
>> // org\tkowalcz\lambda\dadu\RunnableExaple.java:22: error: variable
>> run might not have been initialized
>> //                            run.run();
>> //                            ^
>> //1 error
>>
>> final Runnable run = new Runnable() {
>>       @Override
>>       public void run() {
>>               run.run();
>>       }
>> };
>>
>> It seems inconsistent to me.
>>
>> --
>> Tomasz Kowalczewski
>>
>
>


More information about the lambda-dev mailing list