<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">I'm writing to complain about SE-0031 and Swift 2 compatibility. &nbsp;I understand (and agree with!) the change, but the migration between now and 2017 is annoying, hence my complaint.</div><div class=""><br class=""></div><div class="">In snapshot&nbsp;swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a, we started erroring on the old syntax. &nbsp;That means that this:</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; func foo(inout bar: Int) { }</div><div class=""><br class=""></div><div class="">is not legal Swift 3.</div><div class=""><br class=""></div><div class="">...however, the new syntax:</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; func foo(bar: inout Int) { }</div><div class=""><br class=""></div><div class="">is not legal Swift 2. &nbsp;This complicates compiling for both, which several of my projects currently do.</div><div class=""><br class=""></div><div class="">/<i class="">Further complicating matters</i>/, Swift does not understand line-scoped ifdefs. &nbsp;So this:</div><div class=""><br class=""></div><div class=""><div class="">&nbsp; &nbsp; #if swift(&gt;=3.0)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; func foo(bar: inout Int) {</div><div class="">&nbsp; &nbsp; #else</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; func foo(inout bar: Int) {</div><div class="">&nbsp; &nbsp; #endif</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; //my</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //long</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //functon</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //definition</div><div class="">&nbsp; &nbsp; }</div></div><div class=""><br class=""></div><div class="">Is not legal Swift. &nbsp;The only way I know of is to say:</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; #if swift(&gt;=3.0)<br class="">&nbsp; &nbsp; &nbsp; &nbsp; func foo(bar: inout Int) {<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //my<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //long<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //functon<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //definition<br class="">&nbsp; &nbsp; &nbsp; &nbsp; }<br class="">&nbsp; &nbsp; #else<br class="">&nbsp; &nbsp; &nbsp; &nbsp; func foo(inout bar: Int) {<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //my<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //long<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //functon<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //definition<br class="">&nbsp; &nbsp; &nbsp; &nbsp; }<br class="">&nbsp; &nbsp; #endif</div><div class=""><br class=""></div><div class="">which forces duplication of the entire function definition.</div><div class=""><br class=""></div><div class="">My suggestion would be one or more of the following:</div><div class=""><br class=""></div><div class="">1. &nbsp;Support both syntaxes in Swift 3 "trunk" (e.g. until Swift 3 is released).</div><div class="">2. &nbsp;Backport the new syntax to Swift 2.2</div><div class="">3. &nbsp;Consider allowing line-scoped ifdefs</div><div class=""><br class=""></div><div class="">Thanks for reading, and sorry to rain on a parade I largely think is Good For Swift ™</div><div class=""><br class=""></div><div class="">Drew</div></body></html>