Hello Swift community,
The review of ST-0026: TaskLocal test trait concluded on August 10th, 2026. The Testing Workgroup has decided to accept this proposal with one modification: that the label withValue: be added to value parameter of the static .taskLocal() function which creates an instance of the trait.
The community was clearly in favor of adding this new trait, and nearly all review discussion centered around the topic of this parameter—whether it should have a label, and if so, what it should be. The proposal authors cited SwiftUI's view modifiers as one prominent example of declarative APIs whose parameters are unlabeled. While this can often read unambiguously, a majority of the workgroup members favored including the label withValue: for a few reasons: SwiftUI is a specialized DSL for declaring views and is not necessarily an applicable precedent since it intentionally deviates from Swift's API Naming Guidelines in some cases. Also, some were concerned that the role of the two parameters may not always be clear without one having a label, especially if a task local is referenced without its $ sigil. And, the withValue spelling matches the name of the method for binding a task local which could improve clarity.
Thank you to everyone who participated in the review for helping to improve Swift Testing!
Stuart Montgomery
Review Manager