-
Couldn't load subscription status.
- Fork 125
Implement an overload of confirmation() that takes an unbounded range.
#598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Unbounded ranges are not meaningful when used with `confirmation()` because _any_ confirmation count matches. As well, the `...` operator produces an instance of `UnboundedRange` which is a non-nominal type and cannot conform to `RangeExpression`. It may be non-obvious to a developer why `...` doesn't work as the `expectedCount` argument to that function when other range operators work as expected. This PR implements a stub overload of `confirmation()` that takes an unbounded range. The stub overload is marked unavailable and cannot be called.
|
@swift-ci please test |
| case let errorCode: | ||
| let error = Win32Error(rawValue: errorCode) | ||
| fatalError("unexpected error when getting environment variable '\(name)': \(error) (\(errorCode))") | ||
| fatalError("Unexpected error when getting environment variable '\(name)': \(error) (\(errorCode))") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by formatting tweak.
|
|
||
| default: | ||
| fatalError("Unsupported keyword \(whenKeyword) passed to \(#function)") | ||
| fatalError("Unsupported keyword \(whenKeyword) passed to \(#function). Please file a bug report at https://github.com/swiftlang/swift-testing/issues/new") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by amendment to fatal error message.
|
@swift-ci please test |
|
Self-reviewing (tsk.) |
Unbounded ranges are not meaningful when used with
confirmation()because any confirmation count matches. As well, the...operator produces an instance ofUnboundedRangewhich is a non-nominal type and cannot conform toRangeExpression. It may be non-obvious to a developer why...doesn't work as theexpectedCountargument to that function when other range operators work as expected.This PR implements a stub overload of
confirmation()that takes an unbounded range. The stub overload is marked unavailable and cannot be called.Example usage:
Generated diagnostic:
As a reminder, using a range expression with
confirmation()is an experimental feature and has not been API-reviewed.Checklist: