Skip to content

Commit 17a74fa

Browse files
committed
Fix a new build error as of today's toolchain.
`await` is no longer allowed on an `if` expression, so tweak the code that does that.
1 parent f759bd4 commit 17a74fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Testing/Expectations/ExpectationChecking+Macro.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,8 @@ public func __checkClosureCall<E>(
527527
isRequired: Bool,
528528
sourceLocation: SourceLocation
529529
) async -> Result<Void, any Error> where E: Error {
530-
await if errorType == Never.self {
531-
__checkClosureCall(
530+
if errorType == Never.self {
531+
await __checkClosureCall(
532532
throws: Never.self,
533533
performing: expression,
534534
sourceCode: sourceCode,
@@ -537,7 +537,7 @@ public func __checkClosureCall<E>(
537537
sourceLocation: sourceLocation
538538
)
539539
} else {
540-
__checkClosureCall(
540+
await __checkClosureCall(
541541
performing: expression,
542542
throws: { $0 is E },
543543
mismatchExplanation: { "expected error of type \(errorType), but \(_description(of: $0)) was thrown instead" },

0 commit comments

Comments
 (0)