diff --git a/Sources/NIO/EventLoopFuture.swift b/Sources/NIO/EventLoopFuture.swift index 5eda1f2a4..750871cf7 100644 --- a/Sources/NIO/EventLoopFuture.swift +++ b/Sources/NIO/EventLoopFuture.swift @@ -795,7 +795,7 @@ extension EventLoopFuture { /// /// - returns: The value of the `EventLoopFuture` when it completes. /// - throws: The error value of the `EventLoopFuture` if it errors. - public func wait() throws -> T { + public func wait(file: StaticString = #file, line: UInt = #line) throws -> T { if !(self.eventLoop is EmbeddedEventLoop) { let explainer: () -> String = { """ BUG DETECTED: wait() must not be called when on an EventLoop. @@ -808,8 +808,8 @@ Further information: - event loop associated to future: \(self.eventLoop) """ } - precondition(!eventLoop.inEventLoop, explainer()) - precondition(MultiThreadedEventLoopGroup.currentEventLoop == nil, explainer()) + precondition(!eventLoop.inEventLoop, explainer(), file: file, line: line) + precondition(MultiThreadedEventLoopGroup.currentEventLoop == nil, explainer(), file: file, line: line) } var v: EventLoopFutureValue ? = nil