Skip to content

Commit b1789fd

Browse files
authored
Ensure NonisolatedNonsendingByDefault doesn't break exit tests. (#1383)
When `NonisolatedNonsendingByDefault` is enabled, overload resolution of `ExitTest.__store()` picks the overload that takes any old `T` instead of taking a function. This overload exists only to suppress certain unhelpful compiler diagnostics and its implementation immediately aborts, which causes the described failure. Adding `nonisolated(nonsending)` or `@concurrent` to the "good" overload doesn't appear to satisfy the type checker, so mark the "bad" overload as explicitly disfavoured instead. I am unable to add a unit test for this case due to swiftlang/swift-package-manager#9293. Resolves #1375. ### 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 db3ec85 commit b1789fd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/Testing/ExitTests/ExitTest.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ extension ExitTest {
392392
///
393393
/// - Warning: This function is used to implement the
394394
/// `#expect(processExitsWith:)` macro. Do not use it directly.
395+
@_disfavoredOverload
395396
@safe public static func __store<T>(
396397
_ id: (UInt64, UInt64, UInt64, UInt64),
397398
_ body: T,

0 commit comments

Comments
 (0)