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 @@ -6072,6 +6072,7 @@ swift::isDispatchQueueOperationName(StringRef name) {
60726072 .Case (" sync" , DispatchQueueOperation::Normal)
60736073 .Case (" async" , DispatchQueueOperation::Sendable)
60746074 .Case (" asyncAndWait" , DispatchQueueOperation::Normal)
6075+ .Case (" asyncUnsafe" , DispatchQueueOperation::Normal)
60756076 .Case (" asyncAfter" , DispatchQueueOperation::Sendable)
60766077 .Case (" concurrentPerform" , DispatchQueueOperation::Sendable)
60776078 .Default (std::nullopt );
@@ -6169,8 +6170,7 @@ static AnyFunctionType *applyUnsafeConcurrencyToFunctionType(
61696170 // @MainActor occurs in concurrency contexts or those where we have an
61706171 // application.
61716172 bool addSendable = knownUnsafeParams && inConcurrencyContext;
6172- bool addMainActor =
6173- (isMainDispatchQueue && knownUnsafeParams) &&
6173+ bool addMainActor = isMainDispatchQueue &&
61746174 (inConcurrencyContext || numApplies >= 1 );
61756175 Type newParamType = param.getPlainType ();
61766176 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