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) {
6050
6050
.Case (" sync" , DispatchQueueOperation::Normal)
6051
6051
.Case (" async" , DispatchQueueOperation::Sendable)
6052
6052
.Case (" asyncAndWait" , DispatchQueueOperation::Normal)
6053
+ .Case (" asyncUnsafe" , DispatchQueueOperation::Normal)
6053
6054
.Case (" asyncAfter" , DispatchQueueOperation::Sendable)
6054
6055
.Case (" concurrentPerform" , DispatchQueueOperation::Sendable)
6055
6056
.Default (std::nullopt);
@@ -6147,8 +6148,7 @@ static AnyFunctionType *applyUnsafeConcurrencyToFunctionType(
6147
6148
// @MainActor occurs in concurrency contexts or those where we have an
6148
6149
// application.
6149
6150
bool addSendable = knownUnsafeParams && inConcurrencyContext;
6150
- bool addMainActor =
6151
- (isMainDispatchQueue && knownUnsafeParams) &&
6151
+ bool addMainActor = isMainDispatchQueue &&
6152
6152
(inConcurrencyContext || numApplies >= 1 );
6153
6153
Type newParamType = param.getPlainType ();
6154
6154
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