File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -2795,15 +2795,6 @@ namespace {
27952795 toFnType, /* downgradeToWarning=*/ true );
27962796 break ;
27972797
2798- case FunctionTypeIsolation::Kind::GlobalActor:
2799- // Actor isolation change.
2800- if (fromIsolation.getGlobalActorType ()->isEqual (
2801- toIsolation.getGlobalActorType ())) {
2802- diagnoseNonSendableParametersAndResult (
2803- toFnType, /* downgradeToWarning=*/ true );
2804- }
2805- break ;
2806-
28072798 case FunctionTypeIsolation::Kind::NonIsolated: {
28082799 // Since @execution(concurrent) as an asynchronous
28092800 // function it would mean that without Sendable
@@ -2821,6 +2812,9 @@ namespace {
28212812 // Runs on the actor.
28222813 case FunctionTypeIsolation::Kind::NonIsolatedCaller:
28232814 break ;
2815+
2816+ case FunctionTypeIsolation::Kind::GlobalActor:
2817+ llvm_unreachable (" invalid conversion" );
28242818 }
28252819 break ;
28262820 }
Original file line number Diff line number Diff line change 44// REQUIRES: concurrency
55// REQUIRES: swift_feature_ExecutionAttribute
66
7+ @globalActor
8+ actor MyActor {
9+ static let shared = MyActor ( )
10+ }
11+
712@execution ( concurrent)
813func concurrentTest( ) async {
914}
@@ -132,4 +137,9 @@ func testNonSendableDiagnostics(
132137
133138 let _: @MainActor ( NonSendable) async -> Void = caller1 // Ok
134139 let _: @MainActor ( ) async -> NonSendable = caller2 // Ok
140+
141+ let _: @MyActor ( NonSendable) async -> Void = globalActor1
142+ // expected-error@-1 {{cannot convert value actor-isolated to 'MainActor' to specified type actor-isolated to 'MyActor'}}
143+ let _: @MyActor ( ) async -> NonSendable = globalActor2
144+ // expected-error@-1 {{cannot convert value actor-isolated to 'MainActor' to specified type actor-isolated to 'MyActor'}}
135145}
You can’t perform that action at this time.
0 commit comments