ruby-protocol-buffers icon indicating copy to clipboard operation
ruby-protocol-buffers copied to clipboard

Forward usage of nested enums generates ruby files that can't be loaded

Open sergiocampama opened this issue 7 years ago • 1 comments

Repro: https://github.com/sergiocampama/ruby_proto_repro, just run generate_proto.sh from inside the repo.

What happens is that the MessageB gets added to the forward declaration, but its internal enums are not, so the subsequent usage of the enum type fails to be resolved.

One way to fix this particular would be to forward declare all enums, even nested ones, before messages. Then forward declare the messages and finally then extend the messages with any fields that they have defined.

sergiocampama avatar Mar 19 '18 15:03 sergiocampama

Forward declare of enums => actual definitions

sergiocampama avatar Mar 19 '18 15:03 sergiocampama