Skip to content

[BitwiseCopyable] Avoid a condfail. #73516

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
May 9, 2024

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented May 8, 2024

The standard library defines

protocol BitwiseCopyable {}
typealias _BitwiseCopyable = BitwiseCopyable

For current compilers, BitwiseCopyable is a "known protocol".

For older compilers, it is not; instead _BitwiseCopyable is. So print the following into the swiftinterface for those older compilers:

protocol _BitwiseCopyable {}
typealias BitwiseCopyable = _BitwiseCopyable

rdar://127755503

@nate-chandler nate-chandler force-pushed the rdar127755503 branch 2 times, most recently from 91593a5 to 4927939 Compare May 8, 2024 22:12
Rather than immediately outright banning the old protocol, just make it
be a deprecated typealias for the real one.
The standard library defines
```
protocol BitwiseCopyable {}
typealias _BitwiseCopyable = BitwiseCopyable
```
For current compilers, `BitwiseCopyable` is a "known protocol".

For older compilers, it is not; instead `_BitwiseCopyable` is.  So
print the following into the swiftinterface for those older compilers:
```
protocol _BitwiseCopyable {}
typealias BitwiseCopyable = _BitwiseCopyable
```

rdar://127755503
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler marked this pull request as ready for review May 9, 2024 13:59
@nate-chandler nate-chandler requested review from hborla, slavapestov, xedin and a team as code owners May 9, 2024 13:59
@nate-chandler nate-chandler merged commit 387e8d3 into swiftlang:main May 9, 2024
@nate-chandler nate-chandler deleted the rdar127755503 branch May 9, 2024 14:00
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.

2 participants