@@ -820,25 +820,14 @@ flag, but means something different. Many programmers have internalized the
820
820
SE-0338 semantics, and making this change several years after SE-0338 was
821
821
accepted creates an unfortunate intermediate state where it's difficult to
822
822
understand the semantics of a nonisolated async function without understanding
823
- the build settings of the module you're writing code in. To mitigate these
824
- consequences, the compiler will emit warnings in all language modes
825
- that do not enable this upcoming feature to prompt programmers to explicitly
826
- specify the execution semantics of a nonisolated async function.
827
-
828
- Without the upcoming feature enabled, the compiler will warn if neither
829
- attribute is specified on a nonisolated async function. With the
830
- upcoming feature enabled, the default for a nonisolated async
831
- function is ` @execution(caller) ` . Packages that must support older Swift tools
832
- versions can use ` #if hasAttribute(execution) ` to silence the warning while
833
- maintaining compatibility with tools versions back to Swift 5.8 when
834
- ` hasAttribute ` was introduced:
823
+ the build settings of the module you're writing code in.
835
824
836
- ``` swift
837
- # if hasAttribute(concurrent)
838
- @concurrent
839
- # endif
840
- public func myAsyncAPI () async { ... }
841
- ```
825
+ To make it easy to discover what kind of async function you're working with,
826
+ SourceKit will surface the implicit ` @execution(caller) ` or ` @concurrent `
827
+ attribute for IDE inspection features like Quick Help in Xcode and Hover in
828
+ VSCode. To ease the transition to the upcoming feature flag, [ migration
829
+ tooling ] [ adoption-tooling ] will provide fix-its to preserve behavior by
830
+ annotating nonisolated async functions with ` @concurrent ` .
842
831
843
832
## ABI compatibility
844
833
@@ -987,6 +976,8 @@ function reference instead of when the function is called.
987
976
The proposal was revised with the following changes after the first review:
988
977
989
978
* Renamed ` @execution(concurrent) ` back to ` @concurrent ` .
979
+ * Removed the unconditional warning about nonisolated async functions that
980
+ don't explicitly specify ` @execution(caller) ` or ` @concurrent ` .
990
981
991
982
The proposal was revised with the following changes after the pitch discussion:
992
983
@@ -1004,3 +995,4 @@ The proposal was revised with the following changes after the pitch discussion:
1004
995
[ SE-0297 ] : /proposals/0297-concurrency-objc.md
1005
996
[ SE-0338 ] : /proposals/0338-clarify-execution-non-actor-async.md
1006
997
[ SE-0421 ] : /proposals/0421-generalize-async-sequence.md
998
+ [ adoption-tooling ] : https://forums.swift.org/t/pitch-adoption-tooling-for-upcoming-features/77936
0 commit comments