[swift-evolution] [pitch] Eliminate the "T1 -> T2" syntax, require "(T1) -> T2"

Vladimir.S svabox at gmail.com
Fri Apr 22 18:16:50 CDT 2016


Yes, I believe we all know that Void actually is () and yes, there probably 
some difficulties in implementation of the rules.

The main question right now, as I see it, if we (most of us) agree with 
these rules in general. And then, we can think/ask if such rules could be 
implemented by core team in compiller/parser/etc

Personally I think we need to have just () or just Void, but I feel like 
most of us does not support this idea.

On 23.04.2016 1:58, Alan Skipp wrote:
>> On 22 Apr 2016, at 23:43, Vladimir.S via swift-evolution <swift-evolution at swift.org> wrote:
>>
>> 3. Disallow putting empty tuple () in parentheses
>
> The thing is, Void is a typealias for ()
>
> Therefore the impermissible:
> (()) -> ()
>
> Is identical to:
> (Void) -> ()
>
> So to follow these rules, it must instead be:
> Void -> ()
>
> … and we’re back to T1 -> T2
>
> : )
>


More information about the swift-evolution mailing list