File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -2105,7 +2105,8 @@ void swift::introduceUnsafeInheritExecutorReplacements(
2105
2105
2106
2106
auto isReplaceable = [&](ValueDecl *decl) {
2107
2107
return isa<FuncDecl>(decl) && inConcurrencyModule (decl->getDeclContext ()) &&
2108
- decl->getDeclContext ()->isModuleScopeContext ();
2108
+ decl->getDeclContext ()->isModuleScopeContext () &&
2109
+ cast<FuncDecl>(decl)->hasAsync ();
2109
2110
};
2110
2111
2111
2112
// Make sure at least some of the entries are functions in the _Concurrency
@@ -2160,7 +2161,8 @@ void swift::introduceUnsafeInheritExecutorReplacements(
2160
2161
return ;
2161
2162
2162
2163
auto isReplaceable = [&](ValueDecl *decl) {
2163
- return isa<FuncDecl>(decl) && inConcurrencyModule (decl->getDeclContext ());
2164
+ return isa<FuncDecl>(decl) && inConcurrencyModule (decl->getDeclContext ()) &&
2165
+ cast<FuncDecl>(decl)->hasAsync ();
2164
2166
};
2165
2167
2166
2168
// Make sure at least some of the entries are functions in the _Concurrency
Original file line number Diff line number Diff line change @@ -117,7 +117,12 @@ func unsafeCallerAvoidsNewLoop(clock: some Clock) async throws {
117
117
} onCancel: {
118
118
}
119
119
120
- await TL . $string. withValue ( " hello " ) {
120
+ TL . $string. withValue ( " hello " ) {
121
+ print ( TL . string)
122
+ }
123
+
124
+ try await TL . $string. withValue ( " hello " ) {
125
+ try await Task . sleep ( nanoseconds: 500 )
121
126
print ( TL . string)
122
127
}
123
128
You can’t perform that action at this time.
0 commit comments