Ensure that distributed functions with typed throws can be called from outside the actor #79144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When calling a distributed function for an actor that might not be local, the call can throw due to the distributed actor system producing an error. The function might, independently, also throw. When the function uses typed throws, we incorrectly treated the call is if it would always throw the error type specified by the function. This leads to incorrectly accepting invalid code, and compiler crashes in SILGen.
The change here is to always mark calls to distributed functions outside the actor as "implicitly throwing", which makes sure that we treat the call sites as throwing 'any Error'. The actual handling of the typed throw (from the local function) and the untyped throw (from the distributed actor system) occurs in thunk generation in SILGen, and was already handled correctly.
Fixes rdar://144093249, and undoes the ban introduced by rdar://136467528