Skip to content

Commit 3486411

Browse files
committed
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.
1 parent f2fb70d commit 3486411

File tree

1 file changed

+373
-0
lines changed

1 file changed

+373
-0
lines changed

0 commit comments

Comments
 (0)