[swift-evolution] [Pre-proposal] Fix function type grammar

Vladimir.S svabox at gmail.com
Thu Jul 7 10:11:51 CDT 2016

On 07.07.2016 17:29, Anton Zhilin via swift-evolution wrote:
>     > Questions about that proposal are often risen on the list.
>     > Some think that we will still be able to supply () argument
>     > to () -> T functions.
>     >
>     > To clear that up completely, I suggest adding this grammar change
>     > to SE-0066 or one of the newer proposals. Key idea is that parentheses
>     > are part of function type grammar and have nothing common with tuples
>     > or unit type.
>     Sure, that makes sense to me.  Please submit a PR that expands on
>     SE-0066 when this settles, I don’t think we need another review cycle.
>     Thank you!
>     -Chris
> As SE-0110 is now accepted, you may want to take a look at the pull
> request: https://github.com/apple/swift-evolution/pull/415

1. I still believe that sending () to function declared as 'func foo()' 
should be discussed separately from both(SE-0066,SE-0110), as was not 
mentioned explicitly in proposals and can have more impact on current 
source code than expected in proposals. But it seems no body else care of 
this, so OK, probably I'm not right, I give up. Let's change this.

2. But *do* believe the SE-0066 proposal should be updated in "Impact on 
existing code" part to show how code that relies on the feature of sending 
Void aka () to empty-parameter list function should be changed and how "The 
migrator will automatically add parentheses to existing code when moving 
from Swift 2 to Swift 3" in this case. Because right now this section in 
proposal is just not true.

> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list