Skip to content

Commit 6fa5be7

Browse files
committed
fix TaskLocal tests
1 parent b9b9283 commit 6fa5be7

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

test/Concurrency/global_variables.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ struct TestStatics {
5050
static var computedProperty: Int { 0 } // computed property that, though static, has no storage so is not a global
5151
@TestWrapper static var wrapped: Int // expected-error{{static property 'wrapped' is not concurrency-safe because it is non-isolated global shared mutable state}}
5252
// expected-note@-1{{isolate 'wrapped' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'}}
53-
@TaskLocal static var taskLocal: Int = 0
5453
}
5554

5655
@TestGlobalActor

test/Concurrency/task_local.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@
88
@available(SwiftStdlib 5.1, *)
99
struct TL {
1010
@TaskLocal
11-
static var number: 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+
static var number: Int = 0
1312

1413
@TaskLocal
15-
static var someNil: 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+
static var someNil: Int?
1715

1816
@TaskLocal
1917
static var noValue: Int // expected-error{{'static var' declaration requires an initializer expression or an explicitly stated getter}}
2018
// 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'}}
2319

2420
@TaskLocal
2521
var notStatic: String? // expected-error{{property 'notStatic', must be static because property wrapper 'TaskLocal<String?>' can only be applied to static properties}}

0 commit comments

Comments
 (0)