Skip to content

Don't use a class to store the current exit test. #1065

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

Merged
merged 2 commits into from
Apr 9, 2025

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Apr 8, 2025

This PR replaces the private _CurrentContainer class used to store the current exit test with a bare pointer. The class is prone to duplicate definitions, but we really just use it as a glorified box type for the move-only ExitTest, so an immortal pointer will work just as well.

Works around rdar://148837303.

Checklist:

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

This PR replaces the private `_CurrentContainer` class used to store the current
exit test with a bare pointer. The class is prone to duplicate definitions, but
we really just use it as a glorified box type for the move-only `ExitTest`, so
an immortal pointer will work just as well.

Works around rdar://148837303.
@grynspan grynspan added bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support workaround Workaround for an issue in another component (may need to revert later) exit-tests ☠️ Work related to exit tests labels Apr 8, 2025
@grynspan grynspan added this to the Swift 6.x milestone Apr 8, 2025
@grynspan grynspan self-assigned this Apr 8, 2025
@grynspan
Copy link
Contributor Author

grynspan commented Apr 8, 2025

@swift-ci test

@grynspan
Copy link
Contributor Author

grynspan commented Apr 9, 2025

@swift-ci test

@grynspan grynspan merged commit 6cf0110 into main Apr 9, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/148837303-exittest-container-duplicate branch April 9, 2025 15:45
grynspan added a commit that referenced this pull request Apr 9, 2025
This PR replaces the private `_CurrentContainer` class used to store the
current exit test with a bare pointer. The class is prone to duplicate
definitions, but we really just use it as a glorified box type for the
move-only `ExitTest`, so an immortal pointer will work just as well.

Works around rdar://148837303.

### 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.
grynspan added a commit that referenced this pull request Apr 9, 2025
- **Explanation**: Fixes a spurious runtime warning about duplicate
definitions of an internal class.
  - **Scope**: `ExitTest.current`
  - **Issues**: rdar://148837303
  - **Original PRs**: #1065
  - **Risk**: Low
  - **Testing**: Typical CI testing
  - **Reviewers**: @stmontgomery @briancroom
@stmontgomery stmontgomery modified the milestones: Swift 6.x, Swift 6.2 Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support 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.

2 participants