Commit 84ed66f
committed
Ensure that distributed functions with typed throws can be called from outside
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://1364675281 parent d620886 commit 84ed66f
File tree
6 files changed
+78
-54
lines changed- include/swift/AST
- lib/Sema
- test/Distributed
6 files changed
+78
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5656 | 5656 | | |
5657 | 5657 | | |
5658 | 5658 | | |
5659 | | - | |
5660 | | - | |
5661 | | - | |
5662 | 5659 | | |
5663 | 5660 | | |
5664 | 5661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8397 | 8397 | | |
8398 | 8398 | | |
8399 | 8399 | | |
8400 | | - | |
8401 | | - | |
| 8400 | + | |
8402 | 8401 | | |
8403 | 8402 | | |
8404 | 8403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3554 | 3554 | | |
3555 | 3555 | | |
3556 | 3556 | | |
3557 | | - | |
| 3557 | + | |
3558 | 3558 | | |
3559 | 3559 | | |
3560 | 3560 | | |
3561 | 3561 | | |
3562 | 3562 | | |
3563 | | - | |
3564 | | - | |
3565 | | - | |
3566 | | - | |
3567 | 3563 | | |
3568 | | - | |
| 3564 | + | |
3569 | 3565 | | |
3570 | 3566 | | |
3571 | 3567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | 621 | | |
635 | 622 | | |
636 | 623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
Lines changed: 0 additions & 30 deletions
This file was deleted.
0 commit comments