Skip to content

Commit 5b67c2f

Browse files
authored
Merge pull request swiftlang#73931 from ktoso/wip-validate-tl-use
2 parents 1d58334 + ad3d38a commit 5b67c2f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/Concurrency/Runtime/async_task_locals_basic.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ func simple() async {
9797
TL.$number.withValue(1) {
9898
printTaskLocal(TL.$number) // CHECK-NEXT: TaskLocal<Int>(defaultValue: 0) (1)
9999
}
100+
101+
// async body
102+
await TL.$number.withValue(1) {
103+
await Task.yield()
104+
print("OK: \(TL.number)")
105+
}
106+
107+
// sync body
108+
TL.$number.withValue(1) {
109+
print("OK: \(TL.number)")
110+
}
100111
}
101112

102113
@available(SwiftStdlib 5.1, *)

0 commit comments

Comments
 (0)