File tree 2 files changed +13
-9
lines changed
2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -2795,15 +2795,6 @@ namespace {
2795
2795
toFnType, /* downgradeToWarning=*/ true );
2796
2796
break ;
2797
2797
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
-
2807
2798
case FunctionTypeIsolation::Kind::NonIsolated: {
2808
2799
// Since @execution(concurrent) as an asynchronous
2809
2800
// function it would mean that without Sendable
@@ -2821,6 +2812,9 @@ namespace {
2821
2812
// Runs on the actor.
2822
2813
case FunctionTypeIsolation::Kind::NonIsolatedCaller:
2823
2814
break ;
2815
+
2816
+ case FunctionTypeIsolation::Kind::GlobalActor:
2817
+ llvm_unreachable (" invalid conversion" );
2824
2818
}
2825
2819
break ;
2826
2820
}
Original file line number Diff line number Diff line change 4
4
// REQUIRES: concurrency
5
5
// REQUIRES: swift_feature_ExecutionAttribute
6
6
7
+ @globalActor
8
+ actor MyActor {
9
+ static let shared = MyActor ( )
10
+ }
11
+
7
12
@execution ( concurrent)
8
13
func concurrentTest( ) async {
9
14
}
@@ -132,4 +137,9 @@ func testNonSendableDiagnostics(
132
137
133
138
let _: @MainActor ( NonSendable) async -> Void = caller1 // Ok
134
139
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'}}
135
145
}
You can’t perform that action at this time.
0 commit comments