You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
There is now a WIP implementation that supports throwable getters and setters which can be used inside both computed properties and subscripts. There's still a bit of work left, but hopefully it should be finished soon: #22749
Additional Detail from JIRA
md5: d1f830bfd05395ee30fb2819cb12b391
relates to:
Issue 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.
The text was updated successfully, but these errors were encountered: