Skip to content

Commit 7144ee3

Browse files
Merge pull request #437 from helje5/feature/dizpatchPrecondition-context
Pass along source context in `dispatchPrecondition`
2 parents e6df818 + 91b392d commit 7144ee3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/swift/Dispatch.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public func _dispatchPreconditionTest(_ condition: DispatchPredicate) -> Bool {
3838

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

4747
/// qos_class_t

0 commit comments

Comments
 (0)