File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6050,6 +6050,7 @@ swift::isDispatchQueueOperationName(StringRef name) {
60506050 .Case (" sync" , DispatchQueueOperation::Normal)
60516051 .Case (" async" , DispatchQueueOperation::Sendable)
60526052 .Case (" asyncAndWait" , DispatchQueueOperation::Normal)
6053+ .Case (" asyncUnsafe" , DispatchQueueOperation::Normal)
60536054 .Case (" asyncAfter" , DispatchQueueOperation::Sendable)
60546055 .Case (" concurrentPerform" , DispatchQueueOperation::Sendable)
60556056 .Default (std::nullopt );
@@ -6147,8 +6148,7 @@ static AnyFunctionType *applyUnsafeConcurrencyToFunctionType(
61476148 // @MainActor occurs in concurrency contexts or those where we have an
61486149 // application.
61496150 bool addSendable = knownUnsafeParams && inConcurrencyContext;
6150- bool addMainActor =
6151- (isMainDispatchQueue && knownUnsafeParams) &&
6151+ bool addMainActor = isMainDispatchQueue &&
61526152 (inConcurrencyContext || numApplies >= 1 );
61536153 Type newParamType = param.getPlainType ();
61546154 if (addSendable || addMainActor) {
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ func testMe() {
1717 DispatchQueue . main. async {
1818 onlyOnMainActor ( ) // okay, due to inference of @MainActor-ness
1919 }
20+
21+ DispatchQueue . main. sync {
22+ onlyOnMainActor ( )
23+ }
2024}
2125
2226func testUnsafeSendableInMainAsync( ) async {
You can’t perform that action at this time.
0 commit comments