<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 6, 2016, at 2:35 PM, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class="">Yes, but you can with warnings and fixits. </div><div class=""><br class=""></div><div class="">* The compiler should issue a warning for any use of </div><div class=""><br class=""></div><div class=""><font face="Courier" class="">(n..<m).striding(by: v | v < 0) | n, m, v : Integer</font></div><div class=""><br class=""></div><div class="">with a fixit of "replace <span style="font-family: Courier;" class="">(n..<m) </span>with <span style="font-family: Courier;" class="">(n...m - 1)</span>" regardless of</div><div class="">whether n or m is known at compile time </div><div class=""><br class=""></div><div class="">* If v cannot be known at compile time, I think the compiler should</div><div class="">always prefer ... to ..<.</div><div class=""><br class=""></div><div class="">* The compiler should not allow</div><div class=""><br class=""></div><div class=""><span style="font-family: Courier;" class="">(n..<m).striding(by: v | v < 0) | n, m, v: floating point types</span></div><div class=""><br class=""></div><div class="">where v is known at compile time to be a negative constant. There should </div><div class="">also be a runtime precondition that raises a fatal error should a negative </div><div class="">v be used with a half-open interval.</div><div class=""><br class=""></div><div class="">-- E</div></div></div></blockquote><br class=""></div><div>Following up to myself, this can easily be expanded to the other cases just</div><div>brought up by Xiaodi Wu</div><div><br class=""></div><div>-- E</div><div><br class=""></div><br class=""></body></html>