bitwalker / exprotobuf

Protocol Buffers in Elixir made easy!
Apache License 2.0
486 stars 69 forks source link

filter reserved_numbers and reserved_names tuples when converting from gpb representation #111

Open cheng81 opened 4 years ago

cheng81 commented 4 years ago

The current implementation mistakenly uses reserved_numbers tuples coming from gpb as proto3_msg, since the name in the tuple matches the one used in the proper message definition. The commit simply skips over those tuples, since to the best of my knowledge they are useless in the generated code: those fields are by definition not mentioned in the protobuf message, hence they will never be either written or read. This PR addresses bitwalker/exprotobuf#81

cheng81 commented 4 years ago

I seriously can't find any valid reason to keep the {{:reserved_numbers, _}, _} and {{:reserved_names, _}, _} around, so in the latest commit I just filter them out in Protobuf.Parser directly, so they don't ever creep up in other parts of the code.

cheng81 commented 4 years ago

@bitwalker any chance we can get this reviewed?