Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
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.
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
Sorry, something went wrong.
Throwing subscripts are available in Swift 5.5 due to SE-0310 Effectful Read-only Properties. Should this issue be marked as resolved?
No branches or pull requests