From 91b392d7a22a50f13aa5c2ea0d4a64b14889fee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Mon, 14 Jan 2019 15:34:08 +0100 Subject: [PATCH] Pass along source context in `dispatchPrecondition` `dispatchPrecondition` is great, but it lacks file/line parameters ... --- src/swift/Dispatch.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/swift/Dispatch.swift b/src/swift/Dispatch.swift index 0fd138d6a..2ba819223 100644 --- a/src/swift/Dispatch.swift +++ b/src/swift/Dispatch.swift @@ -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