You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add (hidden) synchronous overloads of #expect(throws:). (#1178)
This PR adds overloads of the `#expect(throws:)` and `#require(throws:)`
macros that take synchronous closures. This is necessary due to a change
in the compiler in Swift 6.2 that improves type checking on closures
passed to macros. The change is a good thing, but it means that the
compiler infers the type of closures passed to these macros as `async`
even when they are synchronous and developers will now get warnings
under some circumstances.
This PR does not constitute an API change. The new overloads are
identical to their `async` peers and there is no change in the
underlying macro expansion logic at compile time or runtime. The PR
serves solely to suppress new spurious warnings that were not emitted in
Swift 6.1 or earlier.
Resolves#1177.
Resolves rdar://149299786.
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
0 commit comments