Skip to content

Commit 4a09505

Browse files
authored
[6.1] Remove the introduced: 6.0 argument from the to-be-deprecated attributes on #expect(performing:throws:) and #require(performing:throws:). (#889)
- **Explanation**: Fix spurious errors building with pre-6.0 language modes when using `#expect(performing:throws:)` or `#require(performing:throws:)`. - **Scope**: Tests written in 5.x language mode that use the to-be-deprecated expectation macros. - **Issues**: N/A - **Original PRs**: #881 - **Risk**: Low - **Testing**: Automated testing/tested at desk. - **Reviewers**: @briancroom @stmontgomery @SeanROlszewski @suzannaratcliff
1 parent a9f21aa commit 4a09505

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Documentation/Proposals/0006-return-errors-from-expect-throws.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ is not statically available. The problematic overloads will also be deprecated:
105105
-) where E: Error & Equatable
106106
+) -> E where E: Error & Equatable
107107

108-
+@available(swift, introduced: 6.0, deprecated: 100000.0, message: "Examine the result of '#expect(throws:)' instead.")
108+
+@available(swift, deprecated: 100000.0, message: "Examine the result of '#expect(throws:)' instead.")
109109
+@discardableResult
110110
@freestanding(expression) public macro expect<R>(
111111
_ comment: @autoclosure () -> Comment? = nil,
@@ -115,7 +115,7 @@ is not statically available. The problematic overloads will also be deprecated:
115115
-)
116116
+) -> (any Error)?
117117

118-
+@available(swift, introduced: 6.0, deprecated: 100000.0, message: "Examine the result of '#require(throws:)' instead.")
118+
+@available(swift, deprecated: 100000.0, message: "Examine the result of '#require(throws:)' instead.")
119119
+@discardableResult
120120
@freestanding(expression) public macro require<R>(
121121
_ comment: @autoclosure () -> Comment? = nil,

Sources/Testing/Expectations/Expectation+Macro.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public macro require<R>(
375375
/// ``expect(throws:_:sourceLocation:performing:)-1hfms`` instead. If the thrown
376376
/// error need only equal another instance of [`Error`](https://developer.apple.com/documentation/swift/error),
377377
/// use ``expect(throws:_:sourceLocation:performing:)-7du1h`` instead.
378-
@available(swift, introduced: 6.0, deprecated: 100000.0, message: "Examine the result of '#expect(throws:)' instead.")
378+
@available(swift, deprecated: 100000.0, message: "Examine the result of '#expect(throws:)' instead.")
379379
@discardableResult
380380
@freestanding(expression) public macro expect<R>(
381381
_ comment: @autoclosure () -> Comment? = nil,
@@ -427,7 +427,7 @@ public macro require<R>(
427427
///
428428
/// If `expression` should _never_ throw, simply invoke the code without using
429429
/// this macro. The test will then fail if an error is thrown.
430-
@available(swift, introduced: 6.0, deprecated: 100000.0, message: "Examine the result of '#require(throws:)' instead.")
430+
@available(swift, deprecated: 100000.0, message: "Examine the result of '#require(throws:)' instead.")
431431
@discardableResult
432432
@freestanding(expression) public macro require<R>(
433433
_ comment: @autoclosure () -> Comment? = nil,

0 commit comments

Comments
 (0)