Skip to content

Commit 032f6cd

Browse files
committed
Update docs a little bit
1 parent d93c801 commit 032f6cd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

stdlib/public/Concurrency/TaskLocal.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,25 @@ public macro TaskLocal() =
2626

2727
#endif
2828

29-
/// Wrapper that defines a task-local value key.
29+
/// Wrapper type that defines a task-local value key.
3030
///
3131
/// A task-local value is a value that can be bound and read in the context of a
32-
/// `Task`. It is implicitly carried with the task, and is accessible by any
33-
/// child tasks the task creates (such as TaskGroup or `async let` created tasks).
32+
/// ``Task``. It is implicitly carried with the task, and is accessible by any
33+
/// child tasks it creates (such as TaskGroup or `async let` created tasks).
3434
///
3535
/// ### Task-local declarations
3636
///
37-
/// Task locals must be declared as static properties (or global properties,
38-
/// once property wrappers support these), like this:
37+
/// Task locals must be declared as static properties or global properties, like this:
3938
///
4039
/// enum Example {
4140
/// @TaskLocal
4241
/// static var traceID: TraceID?
4342
/// }
4443
///
44+
/// // Global task local properties are supported since Swift 6.0:
45+
/// @TaskLocal
46+
/// var contextualNumber: Int = 12
47+
///
4548
/// ### Default values
4649
/// Reading a task local value when no value was bound to it results in returning
4750
/// its default value. For a task local declared as optional (such as e.g. `TraceID?`),

0 commit comments

Comments
 (0)