Skip to content

[BitwiseCopyable] Don't derive on @unchecked field #71242

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

Conversation

nate-chandler
Copy link
Contributor

Allow for a type to conform to BitwiseCopyable but not in such a way that aggregates containing an instance will derive conformance automatically. Useful for types which don't involve reference counting but nonetheless can't simply be copied bit-by-bit.

Allow for a type to conform to BitwiseCopyable but not in such a way
that aggregates containing an instance will derive conformance
automatically.  Useful for types which don't involve reference counting
but nonetheless can't simply be copied bit-by-bit.
The appearance of a field whose type's conformance to BitwiseCopyable is
@unchecked permits the type not to conform.
@nate-chandler nate-chandler force-pushed the bitwise-copyable/not-for-unchecked branch from f797aed to e725c93 Compare January 30, 2024 19:22
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

The pitch calls for such types to obstruct inference of _BitwiseCopyable
in aggregates containing them.
@nate-chandler nate-chandler force-pushed the bitwise-copyable/not-for-unchecked branch from e725c93 to c8119e3 Compare January 30, 2024 22:38
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler marked this pull request as ready for review January 31, 2024 13:55
@nate-chandler nate-chandler merged commit a43faf8 into swiftlang:main Jan 31, 2024
@nate-chandler nate-chandler deleted the bitwise-copyable/not-for-unchecked branch January 31, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant