<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 4 Dec 2015, at 4:01 PM, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" class="">gribozavr@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Fri, Dec 4, 2015 at 4:00 PM, Maxwell Swadling <<a href="mailto:maxs@apple.com" class="">maxs@apple.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">On 4 Dec 2015, at 3:37 PM, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" class="">gribozavr@gmail.com</a>> wrote:<br class=""><br class="">On Fri, Dec 4, 2015 at 3:34 PM, Kevin Ballard <<a href="mailto:kevin@sb.org" class="">kevin@sb.org</a>> wrote:<br class=""><blockquote type="cite" class="">Personally, I'd be in favor of making Optional conform to SequenceType. I've filed a radar on it before, and I seem to recall a message (probably to this list) yesterday suggesting the exact same thing.<br class=""></blockquote><br class="">This would be an interesting direction, but we have discussed it a<br class="">long time ago, and found an issue in the way it would interact with<br class="">implicit promotions to optionals. Basically, in a call to a function<br class="">accepting a Sequence, one would be able to write any non-sequence,<br class="">non-optional value, that would be implicitly promoted to optional, and<br class="">thus eligible to be passed as a Sequence. This is the only argument<br class="">for not adding this conformance that I know of, but it is a show<br class="">stopper unfortunately.<br class=""><br class="">Dmitri<br class=""><br class="">--<br class="">main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br class="">(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" class="">gribozavr@gmail.com</a>>*/<br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></blockquote><br class="">I can not reproduce this behaviour. I'm not sure which version of the compiler had this behaviour.<br class=""></blockquote><br class="">The fact that the compiler does not do it means it is not implementing<br class="">the language model. The compiler is not the source of truth about the<br class="">language, or we wouldn't have any bugs -- they all would be features.<br class=""><br class="">Dmitri<br class=""><br class="">-- <br class="">main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br class="">(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" class="">gribozavr@gmail.com</a>>*/<br class=""></div></div></blockquote></div><br class=""><div class="">I think you were observing a bug at the time and it is safe to say it isn't part of the language. Otherwise programs like this would be accepted:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class="">func f<a: CustomDebugStringConvertible>(x: a) {</font></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class=""> print(x.debugDescription)</font></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class="">}</font></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class="">f(1)</font></div></div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">or</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><font face="Menlo" class="">1.debugDescription</font></div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div></body></html>