[swift-evolution] Generic Subscripts

John McCall rjmccall at apple.com
Sun Jan 15 18:09:37 CST 2017


> On Jan 14, 2017, at 6:41 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> on Fri Jan 13 2017, John McCall <swift-evolution at swift.org> wrote:
> 
>> I'm also not sure we'd ever want the element type to be inferred from
>> context like this.  Generic subscripts as I see it are about being
>> generic over *indexes*, not somehow about presenting a polymorphic
>> value.
> 
> Actually I *would* want to be able to do that, though I admit it's the
> 1% case (or less).

Would you actually want the value type to be inferred, or you would just want it to be allowed to vary according to the index type?  Because the former sounds like a huge usability issue.

John.


More information about the swift-evolution mailing list