> On Jun 9, 2016, at 6:49 PM, Dave Abrahams via swift-evolution > <[email protected]> wrote: > > > on Wed Jun 08 2016, Jordan Rose <[email protected]> wrote: > >>> On Jun 8, 2016, at 13:16, Dave Abrahams via swift-evolution >>> <[email protected]> wrote: >>> >>> >>> on Wed Jun 08 2016, Thorsten Seitz >> >>> <[email protected] >>> <mailto:[email protected]>> >>> wrote: >>> >>>> Ah, thanks, I forgot! I still consider this a bug, though (will have >>>> to read up again what the reasons are for that behavior). >>> >>> Yes, but in the case of the issue we're discussing, the choices are: >>> >>> 1. Omit from the existential's API any protocol requirements that depend >>> on Self or associated types, in which case it *can't* conform to >>> itself because it doesn't fulfill the requirements. >>> >>> 2. Erase type relationships and trap at runtime when they don't line up. >>> >>> Matthew has been arguing against #2, but you can't “fix the bug” without >>> it. >> >> #1 has been my preference for a while as well, at least as a starting >> point. > > I should point out that with the resyntaxing of existentials to > Any<Protocols...>, the idea that Collection's existential doesn't > conform to Collection becomes far less absurd than it was, so maybe this > is not so bad.
the issue I have will all proposed Any<…> so far is that they are rather heavy, and in the case of a replacement for the obj-c id<UITableViewDataSource> or worse MyTVC<UITableViewDataSource> (I know the example is absurd for it stands for a specific concrete type conforming), it involves a bit of magic. So played with a little toy syntax starting from the sugaring you are doing for literals: Array<X> —> [X] Dict<X,Y> —> [X:Y] stretching it to consider that existential are a degenerate form of literal notation, then the following would not look entirely out of place https://gist.github.com/lmihalkovic/8aa66542f5cc4592e967bade260477ef [last example unfinished - missing opening syntax] > > -- > Dave > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
