Skip to content

Commit 3b610fd

Browse files
committed
[Concurrency] Always coalesce the priority optional
1 parent fd32673 commit 3b610fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ extension Task {
9999
/// - SeeAlso: `Task.currentPriority`
100100
@available(*, deprecated, message: "Storing `Task` instances has been deprecated, and as such instance functions on Task are deprecated and will be removed soon. Use the static 'Task.currentPriority' instead.")
101101
public var priority: Priority {
102-
getJobFlags(_task).priority
102+
getJobFlags(_task).priority ?? .default
103103
}
104104

105105
/// Task priority may inform decisions an `Executor` makes about how and when
@@ -879,7 +879,7 @@ public func _runChildTask<T>(
879879
// Set up the job flags for a new task.
880880
var flags = Task.JobFlags()
881881
flags.kind = .task
882-
flags.priority = getJobFlags(currentTask).priority
882+
flags.priority = getJobFlags(currentTask).priority ?? .unspecified
883883
flags.isFuture = true
884884
flags.isChildTask = true
885885

0 commit comments

Comments
 (0)