3
3
/// `require` will return the result of the expression if the matcher passes, and throw an error if not.
4
4
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
5
5
@discardableResult
6
- public func require< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping ( ) throws -> sending T? ) -> SyncRequirement < T > {
6
+ public func require< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping @ Sendable ( ) throws -> sending T? ) -> SyncRequirement < T > {
7
7
return SyncRequirement (
8
8
expression: Expression (
9
9
expression: expression,
@@ -17,7 +17,7 @@ public func require<T>(fileID: String = #fileID, file: FileString = #filePath, l
17
17
/// `require` will return the result of the expression if the matcher passes, and throw an error if not.
18
18
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
19
19
@discardableResult
20
- public func require< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> sending ( ( ) throws -> sending T) ) -> SyncRequirement < T > {
20
+ public func require< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) throws -> sending T) ) -> SyncRequirement < T > {
21
21
return SyncRequirement (
22
22
expression: Expression (
23
23
expression: expression ( ) ,
@@ -31,7 +31,7 @@ public func require<T>(fileID: String = #fileID, file: FileString = #filePath, l
31
31
/// `require` will return the result of the expression if the matcher passes, and throw an error if not.
32
32
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
33
33
@discardableResult
34
- public func require< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> sending ( ( ) throws -> sending T? ) ) -> SyncRequirement < T > {
34
+ public func require< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) throws -> sending T? ) ) -> SyncRequirement < T > {
35
35
return SyncRequirement (
36
36
expression: Expression (
37
37
expression: expression ( ) ,
@@ -45,7 +45,7 @@ public func require<T>(fileID: String = #fileID, file: FileString = #filePath, l
45
45
/// `require` will return the result of the expression if the matcher passes, and throw an error if not.
46
46
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
47
47
@discardableResult
48
- public func require( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> sending ( ( ) throws -> sending Void) ) -> SyncRequirement < Void > {
48
+ public func require( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) throws -> sending Void) ) -> SyncRequirement < Void > {
49
49
return SyncRequirement (
50
50
expression: Expression (
51
51
expression: expression ( ) ,
@@ -61,7 +61,7 @@ public func require(fileID: String = #fileID, file: FileString = #filePath, line
61
61
///
62
62
/// This is provided as an alternative to ``require``, for when you want to be specific about whether you're using ``SyncRequirement`` or ``AsyncRequirement``.
63
63
@discardableResult
64
- public func requires< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping ( ) throws -> sending T? ) -> SyncRequirement < T > {
64
+ public func requires< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure @escaping @ Sendable ( ) throws -> sending T? ) -> SyncRequirement < T > {
65
65
return SyncRequirement (
66
66
expression: Expression (
67
67
expression: expression,
@@ -77,7 +77,7 @@ public func requires<T>(fileID: String = #fileID, file: FileString = #filePath,
77
77
///
78
78
/// This is provided as an alternative to ``require``, for when you want to be specific about whether you're using ``SyncRequirement`` or ``AsyncRequirement``.
79
79
@discardableResult
80
- public func requires< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> sending ( ( ) throws -> sending T) ) -> SyncRequirement < T > {
80
+ public func requires< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) throws -> sending T) ) -> SyncRequirement < T > {
81
81
return SyncRequirement (
82
82
expression: Expression (
83
83
expression: expression ( ) ,
@@ -93,7 +93,7 @@ public func requires<T>(fileID: String = #fileID, file: FileString = #filePath,
93
93
///
94
94
/// This is provided as an alternative to ``require``, for when you want to be specific about whether you're using ``SyncRequirement`` or ``AsyncRequirement``.
95
95
@discardableResult
96
- public func requires< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> sending ( ( ) throws -> sending T? ) ) -> SyncRequirement < T > {
96
+ public func requires< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) throws -> sending T? ) ) -> SyncRequirement < T > {
97
97
return SyncRequirement (
98
98
expression: Expression (
99
99
expression: expression ( ) ,
@@ -109,7 +109,7 @@ public func requires<T>(fileID: String = #fileID, file: FileString = #filePath,
109
109
///
110
110
/// This is provided as an alternative to ``require``, for when you want to be specific about whether you're using ``SyncRequirement`` or ``AsyncRequirement``.
111
111
@discardableResult
112
- public func requires( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> sending ( ( ) throws -> sending Void) ) -> SyncRequirement < Void > {
112
+ public func requires( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) throws -> sending Void) ) -> SyncRequirement < Void > {
113
113
return SyncRequirement (
114
114
expression: Expression (
115
115
expression: expression ( ) ,
@@ -216,7 +216,7 @@ public func requirea<T: Sendable>(fileID: String = #fileID, file: FileString = #
216
216
/// `unwrap` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
217
217
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
218
218
@discardableResult
219
- public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure @escaping ( ) throws -> sending T? ) throws -> T {
219
+ public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure @escaping @ Sendable ( ) throws -> sending T? ) throws -> T {
220
220
try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description: description)
221
221
}
222
222
@@ -226,7 +226,7 @@ public func unwrap<T>(fileID: String = #fileID, file: FileString = #filePath, li
226
226
/// `unwrap` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
227
227
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
228
228
@discardableResult
229
- public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure ( ) -> sending ( ( ) throws -> sending T? ) ) throws -> T {
229
+ public func unwrap< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) throws -> sending T? ) ) throws -> T {
230
230
try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description: description)
231
231
}
232
232
@@ -236,7 +236,7 @@ public func unwrap<T>(fileID: String = #fileID, file: FileString = #filePath, li
236
236
/// `unwraps` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
237
237
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
238
238
@discardableResult
239
- public func unwraps< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure @escaping ( ) throws -> sending T? ) throws -> T {
239
+ public func unwraps< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure @escaping @ Sendable ( ) throws -> sending T? ) throws -> T {
240
240
try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description: description)
241
241
}
242
242
@@ -246,7 +246,7 @@ public func unwraps<T>(fileID: String = #fileID, file: FileString = #filePath, l
246
246
/// `unwraps` will return the result of the expression if it is non-nil, and throw an error if the value is nil.
247
247
/// if a `customError` is given, then that will be thrown. Otherwise, a ``RequireError`` will be thrown.
248
248
@discardableResult
249
- public func unwraps< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure ( ) -> sending ( ( ) throws -> sending T? ) ) throws -> T {
249
+ public func unwraps< T> ( fileID: String = #fileID, file: FileString = #filePath, line: UInt = #line, column: UInt = #column, customError: Error ? = nil , description: String ? = nil , _ expression: @autoclosure ( ) -> ( @ Sendable ( ) throws -> sending T? ) ) throws -> T {
250
250
try requires ( fileID: fileID, file: file, line: line, column: column, customError: customError, expression ( ) ) . toNot ( beNil ( ) , description: description)
251
251
}
252
252
0 commit comments