@@ -123,7 +123,7 @@ public func requires(file: FileString = #file, line: UInt = #line, customError:
123123/// `require` will return the result of the expression if the matcher passes, and throw an error if not.
124124/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
125125@discardableResult
126- public func require< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @escaping ( ) async throws -> T ? ) -> AsyncRequirement < T > {
126+ public func require< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @escaping @ Sendable ( ) async throws -> T ? ) -> AsyncRequirement < T > {
127127 return AsyncRequirement (
128128 expression: AsyncExpression (
129129 expression: expression,
@@ -137,7 +137,7 @@ public func require<T>(file: FileString = #file, line: UInt = #line, customError
137137/// `require` will return the result of the expression if the matcher passes, and throw an error if not.
138138/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
139139@discardableResult
140- public func require< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: ( ) -> ( ( ) async throws -> T ) ) -> AsyncRequirement < T > {
140+ public func require< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: ( ) -> ( @ Sendable ( ) async throws -> T ) ) -> AsyncRequirement < T > {
141141 return AsyncRequirement (
142142 expression: AsyncExpression (
143143 expression: expression ( ) ,
@@ -151,7 +151,7 @@ public func require<T>(file: FileString = #file, line: UInt = #line, customError
151151/// `require` will return the result of the expression if the matcher passes, and throw an error if not.
152152/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
153153@discardableResult
154- public func require< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: ( ) -> ( ( ) async throws -> T ? ) ) -> AsyncRequirement < T > {
154+ public func require< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: ( ) -> ( @ Sendable ( ) async throws -> T ? ) ) -> AsyncRequirement < T > {
155155 return AsyncRequirement (
156156 expression: AsyncExpression (
157157 expression: expression ( ) ,
@@ -167,7 +167,7 @@ public func require<T>(file: FileString = #file, line: UInt = #line, customError
167167///
168168/// This is provided to avoid confusion between `require -> SyncRequirement` and `require -> AsyncRequirement`.
169169@discardableResult
170- public func requirea< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure @escaping ( ) async throws -> T ? ) async -> AsyncRequirement < T > {
170+ public func requirea< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure @escaping @ Sendable ( ) async throws -> T ? ) async -> AsyncRequirement < T > {
171171 return AsyncRequirement (
172172 expression: AsyncExpression (
173173 expression: expression,
@@ -183,7 +183,7 @@ public func requirea<T>(file: FileString = #file, line: UInt = #line, customErro
183183///
184184/// This is provided to avoid confusion between `require -> SyncRequirement` and `require -> AsyncRequirement`
185185@discardableResult
186- public func requirea< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( ( ) async throws -> T ) ) async -> AsyncRequirement < T > {
186+ public func requirea< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) async throws -> T ) ) async -> AsyncRequirement < T > {
187187 return AsyncRequirement (
188188 expression: AsyncExpression (
189189 expression: expression ( ) ,
@@ -199,7 +199,7 @@ public func requirea<T>(file: FileString = #file, line: UInt = #line, customErro
199199///
200200/// This is provided to avoid confusion between `require -> SyncRequirement` and `require -> AsyncRequirement`
201201@discardableResult
202- public func requirea< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( ( ) async throws -> T ? ) ) async -> AsyncRequirement < T > {
202+ public func requirea< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) async throws -> T ? ) ) async -> AsyncRequirement < T > {
203203 return AsyncRequirement (
204204 expression: AsyncExpression (
205205 expression: expression ( ) ,
@@ -256,7 +256,7 @@ public func unwraps<T>(file: FileString = #file, line: UInt = #line, customError
256256/// `unwrap` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
257257/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
258258@discardableResult
259- public func unwrap< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @escaping ( ) async throws -> T ? ) async throws -> T {
259+ public func unwrap< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @escaping @ Sendable ( ) async throws -> T ? ) async throws -> T {
260260 try await requirea ( file: file, line: line, customError: customError, try await expression ( ) ) . toNot ( beNil ( ) )
261261}
262262
@@ -266,7 +266,7 @@ public func unwrap<T>(file: FileString = #file, line: UInt = #line, customError:
266266/// `unwrap` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
267267/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
268268@discardableResult
269- public func unwrap< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: ( ) -> ( ( ) async throws -> T ? ) ) async throws -> T {
269+ public func unwrap< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: ( ) -> ( @ Sendable ( ) async throws -> T ? ) ) async throws -> T {
270270 try await requirea ( file: file, line: line, customError: customError, expression ( ) ) . toNot ( beNil ( ) )
271271}
272272
@@ -276,7 +276,7 @@ public func unwrap<T>(file: FileString = #file, line: UInt = #line, customError:
276276/// `unwrapa` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
277277/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
278278@discardableResult
279- public func unwrapa< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure @escaping ( ) async throws -> T ? ) async throws -> T {
279+ public func unwrapa< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure @escaping @ Sendable ( ) async throws -> T ? ) async throws -> T {
280280 try await requirea ( file: file, line: line, customError: customError, try await expression ( ) ) . toNot ( beNil ( ) )
281281}
282282
@@ -286,6 +286,6 @@ public func unwrapa<T>(file: FileString = #file, line: UInt = #line, customError
286286/// `unwrapa` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
287287/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
288288@discardableResult
289- public func unwrapa< T> ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( ( ) async throws -> T ? ) ) async throws -> T {
289+ public func unwrapa< T: Sendable > ( file: FileString = #file, line: UInt = #line, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) async throws -> T ? ) ) async throws -> T {
290290 try await requirea ( file: file, line: line, customError: customError, expression ( ) ) . toNot ( beNil ( ) )
291291}
0 commit comments