You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Concurrency/actor_isolation.swift
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -940,3 +940,18 @@ actor Counter {
940
940
return counter
941
941
}
942
942
}
943
+
944
+
/// Superclass checks for global actor-qualified class types.
945
+
classC2{}
946
+
947
+
@SomeGlobalActor
948
+
classC3:C2{} // expected-error{{global actor 'SomeGlobalActor'-isolated class 'C3' has different actor isolation from nonisolated superclass 'C2'}}
949
+
950
+
@GenericGlobalActor<U>
951
+
classGenericSuper<U>{}
952
+
953
+
@GenericGlobalActor<[T]>
954
+
classGenericSub1<T>:GenericSuper<[T]>{}
955
+
956
+
@GenericGlobalActor<T>
957
+
classGenericSub2<T>:GenericSuper<[T]>{} // expected-error{{global actor 'GenericGlobalActor<T>'-isolated class 'GenericSub2' has different actor isolation from global actor 'GenericGlobalActor<U>'-isolated superclass 'GenericSuper'}}
// expected-error@-1{{global actor 'GenericGlobalActor<U>'-isolated class 'Subclass2' has different actor isolation from global actor 'GenericGlobalActor<T>'-isolated superclass 'Superclass'}}
201
202
202
203
// Ensure that substitutions work properly when inheriting.
203
204
classSubclass3<V>:Container<(U,V)>.Superclass2{
@@ -218,7 +219,7 @@ class SuperclassWithGlobalActors {
218
219
func j(){}
219
220
}
220
221
221
-
@GenericGlobalActor<String>
222
+
@GenericGlobalActor<String> // expected-error@+1{{global actor 'GenericGlobalActor<String>'-isolated class 'SubclassWithGlobalActors' has different actor isolation from nonisolated superclass 'SuperclassWithGlobalActors'}}
0 commit comments