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(
21052105
21062106 auto isReplaceable = [&](ValueDecl *decl) {
21072107 return isa<FuncDecl>(decl) && inConcurrencyModule (decl->getDeclContext ()) &&
2108- decl->getDeclContext ()->isModuleScopeContext ();
2108+ decl->getDeclContext ()->isModuleScopeContext () &&
2109+ cast<FuncDecl>(decl)->hasAsync ();
21092110 };
21102111
21112112 // Make sure at least some of the entries are functions in the _Concurrency
@@ -2160,7 +2161,8 @@ void swift::introduceUnsafeInheritExecutorReplacements(
21602161 return ;
21612162
21622163 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 ();
21642166 };
21652167
21662168 // 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 {
117117 } onCancel: {
118118 }
119119
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 )
121126 print ( TL . string)
122127 }
123128
You can’t perform that action at this time.
0 commit comments