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) {
6072
6072
.Case (" sync" , DispatchQueueOperation::Normal)
6073
6073
.Case (" async" , DispatchQueueOperation::Sendable)
6074
6074
.Case (" asyncAndWait" , DispatchQueueOperation::Normal)
6075
+ .Case (" asyncUnsafe" , DispatchQueueOperation::Normal)
6075
6076
.Case (" asyncAfter" , DispatchQueueOperation::Sendable)
6076
6077
.Case (" concurrentPerform" , DispatchQueueOperation::Sendable)
6077
6078
.Default (std::nullopt);
@@ -6169,8 +6170,7 @@ static AnyFunctionType *applyUnsafeConcurrencyToFunctionType(
6169
6170
// @MainActor occurs in concurrency contexts or those where we have an
6170
6171
// application.
6171
6172
bool addSendable = knownUnsafeParams && inConcurrencyContext;
6172
- bool addMainActor =
6173
- (isMainDispatchQueue && knownUnsafeParams) &&
6173
+ bool addMainActor = isMainDispatchQueue &&
6174
6174
(inConcurrencyContext || numApplies >= 1 );
6175
6175
Type newParamType = param.getPlainType ();
6176
6176
if (addSendable || addMainActor) {
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ func testMe() {
17
17
DispatchQueue . main. async {
18
18
onlyOnMainActor ( ) // okay, due to inference of @MainActor-ness
19
19
}
20
+
21
+ DispatchQueue . main. sync {
22
+ onlyOnMainActor ( )
23
+ }
20
24
}
21
25
22
26
func testUnsafeSendableInMainAsync( ) async {
You can’t perform that action at this time.
0 commit comments