Conversation
…est case for same scenario with edition 2023
0569d90 to
1456188
Compare
|
For context, here are the checks in the
Notably different is how this One exception: this PR resurrects a check that is done in the parser, related to proto3 and enum values starting at zero. In a prior PR (#260), that check was removed in favor of the later check, which can also work with editions (which can't be done until after options are interpreted since features in editions are options). But in this PR, I've restored the check (very first commit) so that we can provide a more precise error message as well as detect the problem earlier. |
This adds lots of validation of feature values, to mirror the logic performed in
protoc.This also adds some other validation checks that are implemented in
protocbut were not previously implemented here in protocompile.This would have been the last change needed to support editions in protocompile, except it looks like we'll also need to support extra validation of which features are allowed in which editions (see this protoc commit that just landed this week: protocolbuffers/protobuf@b09b3e4).
Since that change includes new stuff in
descriptor.protowhich isn't likely to make it into protobuf-go'sdescriptorpbpackage until v27 is released (or at least until the first release candidate is made available), we'll need to provide a stop-gap here to opt into editions support. I was hoping to just enable editions support in this repo once the work was complete; but now it won't be complete until after the above happens, yet we need to start working with the support that has been implemented so far in order to update logic in the buf CLI. So we'll have to expose the current internal flag to allow importing code (like the buf CLI) to opt into working with editions so we can implement and test editions-related things there.