-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cleaned up generated code for closed Enums #1751
Conversation
Huh, never really thought out this; since the open enums needed it we didn't consider if the closed could avoid the extra generation. @tbkka any thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a nice simplification.
Looks like the PR needs the Reference directory updated also for the plugin tests. |
Hi, any idea why protobuf itself would fail to build? |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415 Appears to be a compiler bug. I've let the protobuf team upstream know, hopefully they can tweak their sources to avoid this since it will be an issue for their customers on older (but supported) versions. |
Think I've got the workflow figured out now, thanks for your help! |
Looks like an upstream fix is coming: protocolbuffers/protobuf#20234 |
And with a respin everything is happy. Thanks for noticing this, merging. |
For closed enums there no special
UNRECOGNIZED
case, so a plain SwiftInt
enum with explicit values can be used directly.This results in the generated
init?(rawValue:)
andvar rawValue
functions not being needed, since the compiler will create them automatically.