Skip to content

Commit 39b06aa

Browse files
committed
[SE-0461] Remove the migration-related warning in favor of automatic migration
tooling.
1 parent f1c56a9 commit 39b06aa

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

proposals/0461-async-function-isolation.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -819,25 +819,14 @@ flag, but means something different. Many programmers have internalized the
819819
SE-0338 semantics, and making this change several years after SE-0338 was
820820
accepted creates an unfortunate intermediate state where it's difficult to
821821
understand the semantics of a nonisolated async function without understanding
822-
the build settings of the module you're writing code in. To mitigate these
823-
consequences, the compiler will emit warnings in all language modes
824-
that do not enable this upcoming feature to prompt programmers to explicitly
825-
specify the execution semantics of a nonisolated async function.
826-
827-
Without the upcoming feature enabled, the compiler will warn if neither
828-
attribute is specified on a nonisolated async function. With the
829-
upcoming feature enabled, the default for a nonisolated async
830-
function is `@execution(caller)`. Packages that must support older Swift tools
831-
versions can use `#if hasAttribute(execution)` to silence the warning while
832-
maintaining compatibility with tools versions back to Swift 5.8 when
833-
`hasAttribute` was introduced:
822+
the build settings of the module you're writing code in.
834823

835-
```swift
836-
#if hasAttribute(concurrent)
837-
@concurrent
838-
#endif
839-
public func myAsyncAPI() async { ... }
840-
```
824+
To make it easy to discover what kind of async function you're working with,
825+
SourceKit will surface the implicit `@execution(caller)` or `@concurrent`
826+
attribute for IDE inspection features like Quick Help in Xcode and Hover in
827+
VSCode. To ease the transition to the upcoming feature flag, [migration
828+
tooling][adoption-tooling] will provide fix-its to preserve behavior by
829+
annotating nonisolated async functions with `@concurrent`.
841830

842831
## ABI compatibility
843832

@@ -986,6 +975,8 @@ function reference instead of when the function is called.
986975
The proposal was revised with the following changes after the first review:
987976

988977
* Renamed `@execution(concurrent)` back to `@concurrent`.
978+
* Removed the unconditional warning about nonisolated async functions that
979+
don't explicitly specify `@execution(caller)` or `@concurrent`.
989980

990981
The proposal was revised with the following changes after the pitch discussion:
991982

@@ -1003,3 +994,4 @@ The proposal was revised with the following changes after the pitch discussion:
1003994
[SE-0297]: /proposals/0297-concurrency-objc.md
1004995
[SE-0338]: /proposals/0338-clarify-execution-non-actor-async.md
1005996
[SE-0421]: /proposals/0421-generalize-async-sequence.md
997+
[adoption-tooling]: https://forums.swift.org/t/pitch-adoption-tooling-for-upcoming-features/77936

0 commit comments

Comments
 (0)