Skip to content

[5.9🍒] emit error when a noncopyable enum has a raw type #66847

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 1 commit into from
Jun 22, 2023

Conversation

kavon
Copy link
Member

@kavon kavon commented Jun 22, 2023

• Description: A raw enum is only useful if you synthesize conformance to RawRepresentable. Since I disabled that synthesis for noncopyable enums, it's simply confusing for people to be able to declare a raw noncopyable enum.
• Risk: Low. Introduces a minor source break to prevent confusion.
• Original PR: #66818
• Reviewed By: @slavapestov
• Testing: regression tests included
• Resolves: rdar://110539937

previously I was allowing these because I thought there was
some representational difference if the enum is raw. it
turns out that a raw enum is only useful if you synthesize
conformance to RawRepresentable. since I disabled that
synthesis it's kind of silly to still allow the raw type
to be written at all.

rdar://110539937
(cherry picked from commit 79332c1)
@kavon kavon requested a review from a team as a code owner June 22, 2023 05:51
@kavon
Copy link
Member Author

kavon commented Jun 22, 2023

@swift-ci please test

@kavon
Copy link
Member Author

kavon commented Jun 22, 2023

@swift-ci please test windows platform

1 similar comment
@kavon
Copy link
Member Author

kavon commented Jun 22, 2023

@swift-ci please test windows platform

@kavon kavon merged commit 1959858 into swiftlang:release/5.9 Jun 22, 2023
@kavon kavon deleted the 5.9-noncopyable-and-raw-error branch June 22, 2023 22:43
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