Skip to content

Commit 07f38ec

Browse files
committed
Generalize test slightly to work on older Swift runtimes.
Older Swift runtimes aren't able to print a TaskPriority value well. Paper over the issue by adding a local CustomStringConvertible conformance.
1 parent 8cd8ca0 commit 07f38ec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/Concurrency/Runtime/async_task_priority_current.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
import Dispatch
1212

13+
// Work around the inability of older Swift runtimes to print a task priority.
14+
extension TaskPriority: CustomStringConvertible {
15+
public var description: String {
16+
"TaskPriority(rawValue: \(rawValue))"
17+
}
18+
}
19+
1320
@available(SwiftStdlib 5.5, *)
1421
func test_detach() async {
1522
let a1 = Task.currentPriority

0 commit comments

Comments
 (0)