Uploaded image for project: 'Swift'
  1. Swift
  2. SR-238

Support throwing subscripts

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: None

      Description

      Support for throwing subscripts would together with generic ones be really nice for JSON mapping/deserializing libraries like mine https://github.com/Anviking/Decodable. It would make subscripts an alternative to custom operators.

      For example:
      subscript<T: SomeProtocol>(key: String) throws -> T

      Would most likely be useful on its own for a lot of other things as well.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              suyashsrijan Suyash Srijan
              Reporter:
              anviking Johannes Lund
              Votes:
              24 Vote for this issue
              Watchers:
              18 Start watching this issue

                Dates

                Created:
                Updated: