@@ -123,7 +123,7 @@ public func requires(fileID: String = #fileID, file: FileString = #filePath, lin
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: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @escaping ( ) async throws -> T ? ) -> AsyncRequirement < T > {
126+ public func require< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @escaping @ Sendable ( ) async throws -> sending T? ) -> AsyncRequirement < T > {
127127 return AsyncRequirement (
128128 expression: AsyncExpression (
129129 expression: expression,
@@ -137,7 +137,7 @@ public func require<T: Sendable>(fileID: String = #fileID, file: FileString = #f
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: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: ( ) -> ( ( ) async throws -> T ) ) -> AsyncRequirement < T > {
140+ public func require< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: ( ) -> ( @ Sendable ( ) async throws -> sending T) ) -> AsyncRequirement < T > {
141141 return AsyncRequirement (
142142 expression: AsyncExpression (
143143 expression: expression ( ) ,
@@ -151,7 +151,7 @@ public func require<T: Sendable>(fileID: String = #fileID, file: FileString = #f
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: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: ( ) -> ( ( ) async throws -> T ? ) ) -> AsyncRequirement < T > {
154+ public func require< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: ( ) -> ( @ Sendable ( ) async throws -> sending T? ) ) -> AsyncRequirement < T > {
155155 return AsyncRequirement (
156156 expression: AsyncExpression (
157157 expression: expression ( ) ,
@@ -167,7 +167,7 @@ public func require<T: Sendable>(fileID: String = #fileID, file: FileString = #f
167167///
168168/// This is provided to avoid confusion between `require -> SyncRequirement` and `require -> AsyncRequirement`.
169169@discardableResult
170- public func requirea< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping ( ) async throws -> T ? ) async -> AsyncRequirement < T > {
170+ public func requirea< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping @ Sendable ( ) async throws -> sending T? ) async -> AsyncRequirement < T > {
171171 return AsyncRequirement (
172172 expression: AsyncExpression (
173173 expression: expression,
@@ -183,7 +183,7 @@ public func requirea<T: Sendable>(fileID: String = #fileID, file: FileString = #
183183///
184184/// This is provided to avoid confusion between `require -> SyncRequirement` and `require -> AsyncRequirement`
185185@discardableResult
186- public func requirea< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( ( ) async throws -> T ) ) async -> AsyncRequirement < T > {
186+ public func requirea< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) async throws -> sending T) ) async -> AsyncRequirement < T > {
187187 return AsyncRequirement (
188188 expression: AsyncExpression (
189189 expression: expression ( ) ,
@@ -199,7 +199,7 @@ public func requirea<T: Sendable>(fileID: String = #fileID, file: FileString = #
199199///
200200/// This is provided to avoid confusion between `require -> SyncRequirement` and `require -> AsyncRequirement`
201201@discardableResult
202- public func requirea< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( ( ) async throws -> T ? ) ) async -> AsyncRequirement < T > {
202+ public func requirea< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) async throws -> sending T? ) ) async -> AsyncRequirement < T > {
203203 return AsyncRequirement (
204204 expression: AsyncExpression (
205205 expression: expression ( ) ,
@@ -266,7 +266,7 @@ public func unwrap<T: Sendable>(fileID: String = #fileID, file: FileString = #fi
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: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: ( ) -> ( ( ) async throws -> T ? ) ) async throws -> T {
269+ public func unwrap< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: ( ) -> ( @ Sendable ( ) async throws -> sending T? ) ) async throws -> T {
270270 try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description: description)
271271}
272272
@@ -286,7 +286,7 @@ public func unwrapa<T: Sendable>(fileID: String = #fileID, file: FileString = #f
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: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure ( ) -> ( ( ) async throws -> T ? ) ) async throws -> T {
289+ public func unwrapa< T: Sendable > ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) async throws -> sending T? ) ) async throws -> T {
290290 try await requirea ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description: description)
291291}
292292
0 commit comments