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

Chris Lattner clattner at apple.com
Sun Jul 3 10:52:11 CDT 2016


> On Jul 3, 2016, at 7:28 AM, Anton Zhilin via swift-evolution <swift-evolution at swift.org> wrote:
> 
> You can view proposed function type grammar here:
> https://gist.github.com/Anton3/9992aa565ff9d230dd4655b1b74a3326

Hi Anton,

This looks correct, but what is the proposal “for”?  This seems like it is just encoding what SE-0066 was about.

-Chris

> 
> Notion of tuple was removed; instead, parentheses are now merely part of 
> function type grammar.
> 
> An important implication is that types () -> T  and  ( () ) -> T become 
> completely different: the first accepts no parameters, and the second 
> accepts a single parameter of type ().
> 
> ===copy of gist begins===
> function-type → ( function-type-parameters opt ) throws-annotation opt -> 
> type
> 
> function-type-parameters → function-type-parameter , function-type-
> parameters
> 
> function-type-parameters → function-type-parameter ...opt
> 
> function-type-parameter → attributes opt inout opt type
> 
> throws-annotation → throws | rethrows
> _______________________________________________
> 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