hg: lambda/lambda/langtools: Bug fixes

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Sep 6 02:57:04 PDT 2010


Minor follow-up - after some tests, I verified that the latest compiler 
doesn't complain about this case:

il.forEach( #( notUsed ) { int j=0; return 0; } ); // Need to catch the checked exception!


Maurizio


On 04/09/10 17:32, maurizio cimadamore wrote:
>    On 04/09/2010 07:21, Ali Ebrahimi wrote:
>    
>> Hi Maurizio,
>> In Howard's sample code:
>>
>> il.forEach( #( notUsed ) { 0 } ); // OK
>>
>> il.forEach( #( notUsed ) { return 0; } ); // OK
>>
>> il.forEach( #( notUsed ) {  } ); // OK
>>
>>
>> But:
>>
>> il.forEach( #( notUsed ) { return notUsed + 0; } ); // Need to catch
>> the checked exception!
>>
>> il.forEach( #( notUsed ) { notUsed + 0; } ); // Need to catch the
>> checked exception!
>>      
> Hi Ali
> these are ok (well, they can be improved, but the result is somewhat
> expected).
>    
>> il.forEach( #( notUsed ) { int j=0; return 0; } ); // Need to catch
>> the checked exception!
>>      
> This is weird, as the untyped parameter is not even used in the lambda
> body - in this case the inferencer should be able to determine that no
> exception is thrown by the lambda body... I will look into that...
>
> Thanks
> Maurizio
>    
>> Best Regards,
>>
>> Ali Ebrahimi
>>
>>      
>
>    



More information about the lambda-dev mailing list