Skip to content

Commit 76a0a53

Browse files
authored
Merge pull request swiftlang#3135 from NotTheNHK/patch-2
[SE-0296] Fix typo
2 parents a3e4924 + e2efe27 commit 76a0a53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

proposals/0296-async-await.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ let dataResource = await loadWebResource("dataprofile.txt")
686686
let dataResource = try await loadWebResource("dataprofile.txt")
687687
```
688688

689-
We chose not to make `await` imply `try` because they are expressing different kinds of concerns: `await` is about a potential suspension point, where other code might execute in between when you make the call and it when it returns, while `try` is about control flow out of the block.
689+
We chose not to make `await` imply `try` because they are expressing different kinds of concerns: `await` is about a potential suspension point, where other code might execute in between when you make the call and when it returns, while `try` is about control flow out of the block.
690690

691691
One other motivation that has come up for making `await` imply `try` is related to task cancellation. If task cancellation were modeled as a thrown error, and every potential suspension point implicitly checked whether the task was cancelled, then every potential suspension point could throw: in such cases `await` might as well imply `try` because every `await` can potentially exit with an error.
692692
Task cancellation is covered in the [Structured Concurrency](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0304-structured-concurrency.md) proposal, and does *not* model cancellation solely as a thrown error nor does it introduce implicit cancellation checks at each potential suspension point.

0 commit comments

Comments
 (0)