Skip to content

Conversation

@grynspan
Copy link
Contributor

@grynspan grynspan commented Oct 27, 2025

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:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

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.

Resolves #1375.
@grynspan grynspan added this to the Swift 6.x (main) milestone Oct 27, 2025
@grynspan grynspan self-assigned this Oct 27, 2025
@grynspan grynspan added the bug 🪲 Something isn't working label Oct 27, 2025
@grynspan grynspan requested a review from jerryjrchen as a code owner October 27, 2025 20:59
@grynspan grynspan added concurrency 🔀 Swift concurrency/sendability issues exit-tests ☠️ Work related to exit tests workaround Workaround for an issue in another component (may need to revert later) labels Oct 27, 2025
Copy link
Contributor

@jerryjrchen jerryjrchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workaround makes sense to me. Is there a compiler bug related to this feature that's worth investigating further? Meaning the disfavored overload here is just a short term fix?

@grynspan
Copy link
Contributor Author

I suspect there's an underlying bug in how textual Swift interfaces are used at compile time, but at this point I don't have a repro case I can hand off to the compiler team.

@grynspan grynspan merged commit b1789fd into main Oct 27, 2025
27 checks passed
@grynspan grynspan deleted the jgrynspan/1375-nonisolated-nonsending branch October 27, 2025 23:35
grynspan added a commit that referenced this pull request Nov 12, 2025
…sts. (#1407)

- **Explanation**: Adjust the (non-ABI-affecting) signature of an
underlying function used by the expansion of the
`#expect(processExitsWith:)` macro so that when Approachable Concurrency
is enabled, we pick the correct overload of said function.
- **Scope**: Exit tests with Approachable Concurrency enabled.
- **Issues**: #1375
- **Original PRs**: #1383
- **Risk**: Low
- **Testing**: Existing CI jobs and manual verification. It is not
possible at this time to write a unit test for this fix due to
swiftlang/swift-package-manager#9293.
- **Reviewers**: @stmontgomery @briancroom @jerryjrchen
stmontgomery added a commit to stmontgomery/swift-testing that referenced this pull request Nov 13, 2025
- **Explanation**: Adjust the (non-ABI-affecting) signature of an underlying function used by the expansion of the `#expect(processExitsWith:)` macro so that when Approachable Concurrency is enabled, we pick the correct overload of said function.
- **Scope**: Exit tests with Approachable Concurrency enabled.
- **Issues**: swiftlang#1375
- **Original PRs**: swiftlang#1383
- **Risk**: Low
- **Testing**: Existing CI jobs and manual verification. It is not possible at this time to write a unit test for this fix due to swiftlang/swift-package-manager#9293.
- **Reviewers**: @grynspan @briancroom @jerryjrchen
stmontgomery added a commit that referenced this pull request Nov 13, 2025
#1421)

- **Explanation**: Adjust the (non-ABI-affecting) signature of an
underlying function used by the expansion of the
`#expect(processExitsWith:)` macro so that when Approachable Concurrency
is enabled, we pick the correct overload of said function.
- **Scope**: Exit tests with Approachable Concurrency enabled.
- **Issues**: #1375
- **Original PRs**:
#1383, #1407
- **Risk**: Low
- **Testing**: Existing CI jobs and manual verification. It is not
possible at this time to write a unit test for this fix due to
swiftlang/swift-package-manager#9293.
- **Reviewers**: @grynspan @briancroom @jerryjrchen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working concurrency 🔀 Swift concurrency/sendability issues exit-tests ☠️ Work related to exit tests workaround Workaround for an issue in another component (may need to revert later)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exit tests fail with SIGTRAP on macOS when the 'NonisolatedNonsendingByDefault' upcoming feature is enabled

3 participants