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/task_local.swift
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -8,18 +8,14 @@
8
8
@available(SwiftStdlib 5.1,*)
9
9
structTL{
10
10
@TaskLocal
11
-
staticvarnumber:Int=0 // expected-complete-warning {{static property 'number' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6}}
12
-
// expected-complete-note@-1 {{isolate 'number' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'}}
11
+
staticvarnumber:Int=0
13
12
14
13
@TaskLocal
15
-
staticvarsomeNil:Int? // expected-complete-warning {{static property 'someNil' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6}}
16
-
// expected-complete-note@-1 {{isolate 'someNil' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'}}
14
+
staticvarsomeNil:Int?
17
15
18
16
@TaskLocal
19
17
staticvarnoValue:Int // expected-error{{'static var' declaration requires an initializer expression or an explicitly stated getter}}
20
18
// expected-note@-1{{add an initializer to silence this error}}
21
-
// expected-complete-warning@-2 {{static property 'noValue' is not concurrency-safe because it is non-isolated global shared mutable state; this is an error in Swift 6}}
22
-
// expected-complete-note@-3 {{isolate 'noValue' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'}}
23
19
24
20
@TaskLocal
25
21
varnotStatic:String? // expected-error{{property 'notStatic', must be static because property wrapper 'TaskLocal<String?>' can only be applied to static properties}}
0 commit comments