<div dir="ltr"><div>+1, but this proposal need further work.</div><div>Specification of the new function grammar is needed.<br></div><div><br></div><div>Currently, it looks like:</div><div><br></div><div><span class="" style="border:0px;font-size:14px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(128,128,128);font-style:italic;font-family:Helvetica,Arial,sans-serif;line-height:20.3px;background-image:initial;background-repeat:initial">function-type </span><span style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:20.3px"></span><span class="" style="border:0px;font-size:14px;margin:0px;outline:0px;padding:0px 0px 0px 4px;vertical-align:baseline;color:rgb(128,128,128);font-family:Helvetica,Arial,sans-serif;line-height:20.3px;background-image:initial;background-repeat:initial">→ </span><span class="" style="border:0px;font-size:14px;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;font-style:italic;color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;line-height:20.3px;background-image:initial;background-repeat:initial"><a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Types.html#//apple_ref/swift/grammar/type" style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,136,204);text-decoration:none;background:transparent">type</a></span><span class="" style="border:0px;font-size:14px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;line-height:20.3px;background-image:initial;background-repeat:initial"><code class="" style="border:0px;font-size:0.86em;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;font-family:Menlo,monospace;font-weight:600;word-wrap:break-word;background:transparent">throws</code><sub class="" style="border:0px;font-size:0.8em;margin-top:0px;margin-right:0px;margin-bottom:0px;outline:0px;padding:0px 4px 0px 0px;color:rgb(128,128,128);font-style:italic;background:transparent">opt</sub></span><code class="" style="border:0px;font-size:0.86em;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;color:rgb(0,0,0);font-family:Menlo,monospace;font-weight:600;word-wrap:break-word;line-height:20.3px;background-image:initial;background-repeat:initial">-></code><span class="" style="border:0px;font-size:14px;margin:0px;outline:0px;padding:0px 4px;vertical-align:baseline;font-style:italic;color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;line-height:20.3px;background-image:initial;background-repeat:initial"><a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Types.html#//apple_ref/swift/grammar/type" style="border:0px;margin:0px;outline:0px;padding:0px;vertical-align:baseline;color:rgb(0,136,204);text-decoration:none;background:transparent">type</a></span><br></div><div><br></div><div>It is already false, because some attributes can only be used in function types.</div><div><br></div><div>I suggest to rewrite it to something like:</div><div><p style="margin-bottom:0.0001pt;line-height:115%"><em><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-type</span></em><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">→<span class=""> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">(</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-parameter-types</span></em><sub style=""><span style="font-size:9pt;line-height:115%;font-family:Helvetica,sans-serif;color:rgb(51,51,51)">opt</span></sub><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">)</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">-></span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">type</span></em><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"></span></p>
<p style="margin:0cm 0cm 0.0001pt;line-height:115%"><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-type</span></em><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">→<span class=""> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">(</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-parameter-types</span></em><sub style=""><span style="font-size:9pt;line-height:115%;font-family:Helvetica,sans-serif;color:rgb(51,51,51)">opt</span></sub><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">)</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">throws</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">-></span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">type</span></em><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"></span></p>
<p style="margin:0cm 0cm 0.0001pt;line-height:115%"><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-type</span></em><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">→<span class=""> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">(</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-parameter-types</span></em><sub style=""><span style="font-size:9pt;line-height:115%;font-family:Helvetica,sans-serif;color:rgb(51,51,51)">opt</span></sub><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">)</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">rethrows</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">-></span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">type</span></em><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"></span></p>
<p style="margin:0cm 0cm 0.0001pt;line-height:115%"><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-parameter-types</span></em><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">→<span class=""> </span><em style="">function-parameter-type</em></span></p><p style="margin:0cm 0cm 0.0001pt;line-height:115%"><em style="line-height:14.95px"><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-parameter-types</span></em><span class="" style="line-height:14.95px"><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><span style="line-height:14.95px;font-family:Helvetica,sans-serif;color:rgb(51,51,51)">→<span class=""> </span></span><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"><em style="">function-parameter-type</em><span class=""> </span></span><code style="border-radius:3px;background-color:rgba(0,0,0,0.0392157)"><span style="font-size:10pt;line-height:115%;font-family:Consolas;color:rgb(51,51,51)">,</span></code><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-parameter-types</span></em><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"></span></p>
<p style="margin-top:0cm;line-height:115%"><em style=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">function-parameter-type</span></em><span class=""><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)"> </span></span><span style="font-family:Helvetica,sans-serif;color:rgb(51,51,51)">→<span class=""> </span><em style="">function-parameter-attributes</em><span class=""> </span><em style="">type</em></span></p></div><div>It will also eliminate situation when you can pass () argument to a () → T function.</div><div>Function types Void->T will need to be migrated.</div><div><br></div><div>- Anton</div></div>