on Sun Jan 15 2017, John McCall <rjmccall-AT-apple.com> wrote:

>> On Jan 14, 2017, at 6:41 PM, Dave Abrahams via swift-evolution 
>> <[email protected]> wrote:
>> on Fri Jan 13 2017, John McCall <[email protected]> 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.

Both.  Usability-wise, it's no worse than f<T>() -> T, which has its
(rare) uses today and doesn't cause a problem when it's not used.
Ideally I'd like to be able to guide deduction to pick a sensible
default for T when there's insufficient type context, but that's a
separable feature.

-- 
-Dave
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to