[Proto3] Error compiling reserved values in enum
According to this documentation for proto3 (https://developers.google.com/protocol-buffers/docs/proto3#enum_reserved), you can add reserved values using the reserved statement, but this no longer compiles.
enum Foo {
reserved 2, 15, 9 to 11, 40 to max;
reserved "FOO", "BAR";
}
What's the error message?
Missing numeric value for enum constant.
Which version were you using? This I believe was first introduced in 3.5.0.
Confirmed that on 3.5.0, reserved works, however it says "The first enum value must be zero in proto3." So it seems 0 cannot be reserved.
Why is is that you are saying protobuf version must be >= 3.5.0 when the protobuf documentation shows reserved as a functional keyword for both proto2 and proto3?--as though reserved should have been working long before 3.5.0.
Sorry for the confusion around this but usually when we talk about proto2 and proto3 we don't mean the version number (like 3.5.0) but instead we are talking about whether you have syntax = "proto2" or syntax = "proto3" at the top of your .proto file. We are actively maintaining both proto2 and proto3, so we have introduced some new proto2 features in 3.x releases.
I see. That makes sense. Thanks for clarifying this. It would be worth the effort to document it somewhere clearly, perhaps on the readme page or at the tops of the proto2 and proto3 pages I linked to above.