@@ -819,25 +819,14 @@ flag, but means something different. Many programmers have internalized the
819
819
SE-0338 semantics, and making this change several years after SE-0338 was
820
820
accepted creates an unfortunate intermediate state where it's difficult to
821
821
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.
834
823
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 ` .
841
830
842
831
## ABI compatibility
843
832
@@ -986,6 +975,8 @@ function reference instead of when the function is called.
986
975
The proposal was revised with the following changes after the first review:
987
976
988
977
* 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 ` .
989
980
990
981
The proposal was revised with the following changes after the pitch discussion:
991
982
@@ -1003,3 +994,4 @@ The proposal was revised with the following changes after the pitch discussion:
1003
994
[ SE-0297 ] : /proposals/0297-concurrency-objc.md
1004
995
[ SE-0338 ] : /proposals/0338-clarify-execution-non-actor-async.md
1005
996
[ 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