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/predates_concurrency.swift
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -271,6 +271,19 @@ do {
271
271
nil
272
272
}
273
273
274
+
@preconcurrency
275
+
openvartest5:(@MainActor()->Void)?{ // expected-note {{overridden declaration is here}}
276
+
nil
277
+
}
278
+
279
+
openvartest6:(@MainActor()->Void)?{ // expected-note {{attempt to override property here}}
280
+
nil
281
+
}
282
+
283
+
@preconcurrency
284
+
func test7(_:(@MainActor()->Void)?=nil){ // expected-note {{overridden declaration is here}}
285
+
}
286
+
274
287
init(){
275
288
self.test1 =nil
276
289
self.test2 =[:]
@@ -301,6 +314,20 @@ do {
301
314
// expected-warning@-1 {{declaration 'test4' has a type with different sendability from any potential overrides; this is an error in the Swift 6 language mode}}
302
315
nil
303
316
}
317
+
318
+
overridevartest5:(()->Void)?{
319
+
// expected-warning@-1 {{declaration 'test5' has a type with different global actor isolation from any potential overrides; this is an error in the Swift 6 language mode}}
320
+
nil
321
+
}
322
+
323
+
overridevartest6:(()->Void)?{
324
+
// expected-error@-1 {{property 'test6' with type '(() -> Void)?' cannot override a property with type '(@MainActor () -> Void)?'}}
325
+
nil
326
+
}
327
+
328
+
overridefunc test7(_:(()->Void)?){
329
+
// expected-warning@-1 {{declaration 'test7' has a type with different global actor isolation from any potential overrides; this is an error in the Swift 6 language mode}}
// expected-warning@-1 {{declaration 'withMainActorId' has a type with different global actor isolation from any potential overrides; this is an error in the Swift 6 language mode}}
75
+
}
76
+
77
+
classSubTestWithActor:Test{
78
+
@objcoverridefunc withMainActorId(_:@MainActor@escaping(Any)->Void){} // Ok
// expected-warning@-1 {{declaration 'withMainActorId' has a type with different global actor isolation from any potential overrides; this is an error in the Swift 6 language mode}}
76
+
}
77
+
78
+
classSubTestWithActor:Test{
79
+
@objcoverridefunc withMainActorId(_:@MainActor@escaping(Any)->Void){} // Ok
0 commit comments