[swift-evolution] [Proposal] Generic and `throw`ing subscripts
Robert Widmann
rwidmann at apple.com
Mon Jun 20 20:33:42 CDT 2016
Closures are a valid argument to pass to a subscript. Granted, I’m not sure of a use-case, but it’s certainly something that is possible.
> On Jun 20, 2016, at 5:54 PM, Dany St-Amant <dsa.mls at icloud.com> wrote:
>
>
> Le 20 juin 2016 à 14:10, Robert Widmann via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> a écrit :
>
>> This change will modify and add the following productions in the Swift grammar
>>
>> GRAMMAR OF A SUBSCRIPT DECLARATION
>>
>> subscript-declaration → subscript-head subscript-result code-block
>> subscript-declaration → subscript-head subscript-result getter-setter-block
>> subscript-declaration → subscript-head subscript-result getter-setter-keyword-block
>> -subscript-head → attributes(opt) declaration-modifiers(opt) subscript parameter-clause
>> +subscript-head → attributes(opt) declaration-modifiers(opt) generic-parameter-clause(opt) subscript parameter-clause
>> +subscript-result → -> attributes(opt) throws(opt) type
>> +subscript-result → -> attributes(opt) rethrows(opt) type
> I am no expert in throws, but since there's no closure involved I think that 'rethrows' doesn't apply here.
>
> Dany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160620/122c3dfc/attachment.html>
More information about the swift-evolution
mailing list