Skip to content

Pass along source context in dispatchPrecondition #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/swift/Dispatch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public func _dispatchPreconditionTest(_ condition: DispatchPredicate) -> Bool {

@_transparent
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
public func dispatchPrecondition(condition: @autoclosure () -> DispatchPredicate) {
public func dispatchPrecondition(condition: @autoclosure () -> DispatchPredicate, file: StaticString = #file, line: UInt = #line) {
// precondition is able to determine release-vs-debug asserts where the overlay
// cannot, so formulating this into a call that we can call with precondition()
precondition(_dispatchPreconditionTest(condition()), "dispatchPrecondition failure")
precondition(_dispatchPreconditionTest(condition()), "dispatchPrecondition failure", file: file, line: line)
}

/// qos_class_t
Expand Down