-
Notifications
You must be signed in to change notification settings - Fork 128
Ensure NonisolatedNonsendingByDefault doesn't break exit tests.
#1383
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
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.
jerryjrchen
left a comment
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.
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?
|
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. |
…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
- **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
#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
When
NonisolatedNonsendingByDefaultis enabled, overload resolution ofExitTest.__store()picks the overload that takes any oldTinstead 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@concurrentto 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: