6.0: [BitwiseCopyable] Avoid a condfail. #73538
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: Fix a condfail related to BitwiseCopyable renaming.
Once the evolution proposal was accepted, the protocol was renamed from
_BitwiseCopyable
toBitwiseCopyable
. Old compilers still only "know about"_BitwiseCopyable
, however--it is a "known protocol" for them. They only permit suppression of_BitwiseCopyable
and notBitwiseCopyable
. This is a problem for the new standard library's swiftinterface which includes several suppressions ofBitwiseCopyable
.The solution is to keep defining the
_BitwiseCopyable
protocol in the standard library's swiftinterface as understood by older compilers while definingBitwiseCopyable
to be a typealias for it. Meanwhile, when current compilers read the same swiftinterface, they will seeBitwiseCopyable
to be defined as a protocol and_BitwiseCopyable
to be a typealias for it.Scope: Affects ASTPrinting of the BitwiseCopyable protocol and its deprecated typealias.
Issue: rdar://127755503
Original PR: #73516
Risk: Very low. Only affects ASTPrinting of two declarations.
Testing: Added tests.
Reviewer: Allan Shortlidge ( @tshortli )