[swift-evolution] Reconsidering the (Element -> T?) variant of SequenceType.flatMap

Dmitri Gribenko gribozavr at gmail.com
Fri Dec 4 17:59:21 CST 2015


On Fri, Dec 4, 2015 at 3:52 PM, Kevin Ballard <kevin at sb.org> wrote:
> Can implicit optional promotion not be redefined to only occur when the
> destination type is explicitly optional (as opposed to being generic)?
> The problem you describe sounds like it could affect third-party code as
> well if anyone has a reason to declare a protocol and extend Optional to
> conform to it.

It can be created by third-party code, but many other problems can be
created by third-party code, too (like making String conform to
IntegerLiteralConvertible), so it is not a concern for me in that
sense.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-evolution mailing list