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 @@ -6058,6 +6058,7 @@ swift::isDispatchQueueOperationName(StringRef name) {
6058
6058
.Case (" sync" , DispatchQueueOperation::Normal)
6059
6059
.Case (" async" , DispatchQueueOperation::Sendable)
6060
6060
.Case (" asyncAndWait" , DispatchQueueOperation::Normal)
6061
+ .Case (" asyncUnsafe" , DispatchQueueOperation::Normal)
6061
6062
.Case (" asyncAfter" , DispatchQueueOperation::Sendable)
6062
6063
.Case (" concurrentPerform" , DispatchQueueOperation::Sendable)
6063
6064
.Default (std::nullopt);
@@ -6155,8 +6156,7 @@ static AnyFunctionType *applyUnsafeConcurrencyToFunctionType(
6155
6156
// @MainActor occurs in concurrency contexts or those where we have an
6156
6157
// application.
6157
6158
bool addSendable = knownUnsafeParams && inConcurrencyContext;
6158
- bool addMainActor =
6159
- (isMainDispatchQueue && knownUnsafeParams) &&
6159
+ bool addMainActor = isMainDispatchQueue &&
6160
6160
(inConcurrencyContext || numApplies >= 1 );
6161
6161
Type newParamType = param.getPlainType ();
6162
6162
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