-
Notifications
You must be signed in to change notification settings - Fork 569
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
Generate unrecognized constant for enums if option is true #2885
Generate unrecognized constant for enums if option is true #2885
Conversation
constants = enum.constants + listOf( | ||
EnumConstant( | ||
location = enum.location, | ||
name = "UNRECOGNIZED", | ||
tag = -1, | ||
documentation = "", | ||
options = Options(optionType = ENUM_OPTIONS, optionElements = listOf()), | ||
), | ||
), |
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.
super-nit: the order perhaps does not matter but does protoc list -1
tag first?
constants = enum.constants + listOf( | |
EnumConstant( | |
location = enum.location, | |
name = "UNRECOGNIZED", | |
tag = -1, | |
documentation = "", | |
options = Options(optionType = ENUM_OPTIONS, optionElements = listOf()), | |
), | |
), | |
constants = listOf( | |
EnumConstant( | |
location = enum.location, | |
name = "UNRECOGNIZED", | |
tag = -1, | |
documentation = "", | |
options = Options(optionType = ENUM_OPTIONS, optionElements = listOf()), | |
), | |
) + enum.constants, |
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.
protoc adds it at the end. But it doesn't matter really. We can put it in front
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.
done
No description provided.