Primitive specializations

Brian Goetz brian.goetz at oracle.com
Fri Jun 14 12:59:50 PDT 2013


We tried this already.  Indeed, we ran into issues with ambiguities of 
the sort you describe.

On 6/14/2013 3:51 PM, Paul Benedict wrote:
> I believe the problem with that kind of specialization is that it makes
> Java box the primitive types. The current scheme avoids that performance
> penalty.
>
>
> On Fri, Jun 14, 2013 at 2:41 PM, Jose <jgetino at telefonica.net> wrote:
>
>> In the spirit of the primitive specializations of Iterator I wonder if it
>> would be possible to make LongConsumer being a specialization of
>> Consumer<Long>.
>>
>>
>>
>> On the other hand I would like to know if it can be expected that in future
>> releases the compiler will be able to disambiguate between
>>
>>
>>
>> foo(LongConsumer c)         and        foo(Cosumer<Long>.c)
>>
>>
>>
>> when a lambda is passed as argument.
>>
>>
>>
>> Thanks
>>
>>
>>
>>
>>
>>
>>
>> .
>>
>>
>>
>>
>>
>>
>>
>


More information about the lambda-dev mailing list