> On Aug 16, 2016, at 5:30 PM, Xiaodi Wu <xiaodi...@gmail.com> wrote: > > On Tue, Aug 16, 2016 at 5:19 PM, Charles Srstka via swift-evolution > <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote: >> On Aug 16, 2016, at 5:13 PM, David Sweeris <daveswee...@mac.com >> <mailto:daveswee...@mac.com>> wrote: >> >> Any proposal that expands the power of generic programming gets an almost >> automatic +1 from me. >> >> I can't think of any circumstances in which I wouldn't want to use ":==" >> instead of ":". Are there any downsides to expanding ":" to mean what ":==" >> does? >> >> Incidentally, I kinda thought things either already worked like this, or >> would work like this after generics were "completed", but I can't tell you >> why I thought that. > > Me neither, but the last time I proposed that, people stated that there were > some cases where this could not work. No concrete examples were given, but I > assume it probably has something to do with associated type wackiness. :== > seems like a workable compromise to me. > > If an existential of a protocol P doesn't conform to itself, what can you do > inside the body of a generic function that has a generic constraint specified > with `:==`? In other words, what would we know about what's in common between > such an existential of a protocol and types that conform to the protocol?
My proposal is that in such cases, using :== would lead to a compiler error. Charles
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution