Skip to content
New issue

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? Sign in to your account

Adopt typed throws #3884

Open
stefanceriu opened this issue Mar 10, 2025 · 0 comments
Open

Adopt typed throws #3884

stefanceriu opened this issue Mar 10, 2025 · 0 comments
Labels
A-DevX Anything that can improve the DevX T-Task

Comments

@stefanceriu
Copy link
Member

In SE-413 the concept of typed throws has been introduced to Swift.

We have designed Element X around Results particularly to be able to specify the exact type of a returning error but with typed throws in place we now migrate to using this language feature.

One complication here is the mocks we generate through sourcery. They recently added support for typed throws as well in krzysztofzablocki/Sourcery#1401 but our templates are heavily modified to bring thread safeness to the mocks. They were crashing on parallel testing and we fixed that by introducing dispatch queues on accessing properties.

Ideally, with swift concurrency now being more established, we would take the upstream templates (and typed throws support) and reimplement thread safety on top using the new mechanisms, perhaps even contribute it back to the community.

@stefanceriu stefanceriu added the A-DevX Anything that can improve the DevX label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-DevX Anything that can improve the DevX T-Task
Projects
None yet
Development

No branches or pull requests

2 participants