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 @@ -2108,7 +2108,8 @@ void swift::introduceUnsafeInheritExecutorReplacements(
2108
2108
2109
2109
auto isReplaceable = [&](ValueDecl *decl) {
2110
2110
return isa<FuncDecl>(decl) && inConcurrencyModule (decl->getDeclContext ()) &&
2111
- decl->getDeclContext ()->isModuleScopeContext ();
2111
+ decl->getDeclContext ()->isModuleScopeContext () &&
2112
+ cast<FuncDecl>(decl)->hasAsync ();
2112
2113
};
2113
2114
2114
2115
// Make sure at least some of the entries are functions in the _Concurrency
@@ -2163,7 +2164,8 @@ void swift::introduceUnsafeInheritExecutorReplacements(
2163
2164
return ;
2164
2165
2165
2166
auto isReplaceable = [&](ValueDecl *decl) {
2166
- return isa<FuncDecl>(decl) && inConcurrencyModule (decl->getDeclContext ());
2167
+ return isa<FuncDecl>(decl) && inConcurrencyModule (decl->getDeclContext ()) &&
2168
+ cast<FuncDecl>(decl)->hasAsync ();
2167
2169
};
2168
2170
2169
2171
// 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