rust-protobuf icon indicating copy to clipboard operation
rust-protobuf copied to clipboard

No support for "reserved" keyword in `enum`

Open DavidZemon opened this issue 1 year ago • 0 comments

protobuf-codegen v3.2.0 appears to fail when using an enum with a reserved field - either reserved ID or reserved name. Both of the following enums cause a failure:


enum PackageId {
  reserved 8;

  unknownPackage = 0;
  alertCommands = 1;
  apduCommands = 2;
  channel = 3;
}
enum ProcId {
  reserved "fingerProcessNext";

  setupRequest = 0;
  tempKeyDelivery = 1;
}

It fails on PackageId first, and here's the error that it throws:

  codegen failed: parse and typecheck

  Caused by:
      0: using pure parser
      1: error in `/path/to/my/protos/commonDataTypes.proto`: at 8:12: While parsing enum field, expecting char `=`
      2: at 8:12: While parsing enum field, expecting char `=`
      3: While parsing enum field, expecting char `=`

DavidZemon avatar Apr 17 '23 19:04 DavidZemon