Skip to content

[Distributed] ban typed throws in distributed funcs #79043

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

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jan 30, 2025

Description: typed throws were never correctly implemented for distributed functions and can lead to incorrect code which claims to throw E, but CAN throw any Error. We should ban typed throws on distributed funcs until we properly solve this integration between those two.
Scope/Impact: Low, only distributed funcs which declare typed throws -- which always was incorrect.
Risk: Low, no known to me code does this.
Testing: CI testing
Reviewed by: @hborla

Original PR: #78978
Radar: rdar://136467528

They don't yield a correct error type as we didn't implement it, so
rather allow it and risk crashes, ban it until we get the time to
implement it.

The real solution is to adjust typed throws error inference to do an
union of the thrown error of the func and the type thrown by the
distributed actor system remote call -- which today always would be (E |
Error) -> Error...

We could add a new associated type to DAS and then we could make it more
proper...

resolves rdar://136467528

Update DiagnosticsSema.def

Co-authored-by: Holly Borla <[email protected]>

Update test/Distributed/distributed_actor_unsupported_typed_throws.swift
@ktoso ktoso marked this pull request as ready for review January 30, 2025 11:46
@ktoso ktoso requested a review from a team as a code owner January 30, 2025 11:46
@ktoso
Copy link
Contributor Author

ktoso commented Jan 30, 2025

@swift-ci please test

@ktoso ktoso enabled auto-merge January 30, 2025 17:57
@ktoso ktoso merged commit 97b8bd3 into release/6.1 Jan 30, 2025
5 checks passed
@ktoso ktoso deleted the pick-dee96d9516e05c0fa1a402c651d8c6c93faee883 branch January 30, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants