<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. 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 swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a, we started erroring on the old syntax. That means that this:</div><div class=""><br class=""></div><div class=""> 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=""> func foo(bar: inout Int) { }</div><div class=""><br class=""></div><div class="">is not legal Swift 2. 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. So this:</div><div class=""><br class=""></div><div class=""><div class=""> #if swift(>=3.0)</div><div class=""> func foo(bar: inout Int) {</div><div class=""> #else</div><div class=""> func foo(inout bar: Int) {</div><div class=""> #endif</div><div class=""> //my</div><div class=""> //long</div><div class=""> //functon</div><div class=""> //definition</div><div class=""> }</div></div><div class=""><br class=""></div><div class="">Is not legal Swift. The only way I know of is to say:</div><div class=""><br class=""></div><div class=""> #if swift(>=3.0)<br class=""> func foo(bar: inout Int) {<br class=""> //my<br class=""> //long<br class=""> //functon<br class=""> //definition<br class=""> }<br class=""> #else<br class=""> func foo(inout bar: Int) {<br class=""> //my<br class=""> //long<br class=""> //functon<br class=""> //definition<br class=""> }<br class=""> #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. Support both syntaxes in Swift 3 "trunk" (e.g. until Swift 3 is released).</div><div class="">2. Backport the new syntax to Swift 2.2</div><div class="">3. 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>