void vs Void

Zhong Yu zhong.j.yu at gmail.com
Fri Nov 16 09:10:12 PST 2012


On Fri, Nov 16, 2012 at 10:39 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> On 11/16/2012 04:57 PM, Brian Goetz wrote:
>> It is possible :)
>>
>> We had this on the list of things to clean up as part of this effort,
>> but it looks like we're not going to have the time.
>
> Zhong Yu, for your information, some members of the EG are also eager to
> have this,
> at least the ones that often implement some Visitor<Void> :)
> so this issue will not be fixed for Java 8 but will be fixed ASAP.

Cool. I guess the real problem is if we make another visitor class
just for `void`, we'll have to name it, and naming is no fun.

>
> Rémi
>
>>
>> On 11/16/2012 10:37 AM, Zhong Yu wrote:
>>> If a method returns Void, the method body must "return null;"
>>> somewhere. That is ugly in a lambda expression. Is it possible that
>>> the compiler adds the "return null" implicitly?
>>>
>>>       Void foo(){ System.out.println("foo"); }
>>>
>>> Zhong Yu
>>>
>
>


More information about the lambda-dev mailing list