> On Jan 12, 2017, at 1:37 PM, Slava Pestov via swift-evolution
> <email@example.com> wrote:
>> Before I submit it, could someone let me know if adding generics to
>> subscripts would influence the ABI? ( still feel pretty clueless in that
> It won’t change the ABI of existing subscript calls, but if the standard
> library introduces new generic subscripts that replace older non-generic
> subscripts, it will impact ABI.
Specifically, we currently have to have a _Hashable protocol that has a
_toAnyHashable() method in order to implement Dictionary<AnyHashable,*>
subscripting using concrete types as keys. A replacement subscript that was
generic over all Hashable types would solve this more neatly, and would be
source-compatible, but affects the ABI of the stdlib.
Generic subscripts would also make it easier to implement one-sided ranges e.g.
myCollection[i...] // slice from i to the end
swift-evolution mailing list