Open jsmankoo opened 5 years ago
This could be potentially resolved if all messages were not generated directly as records, but as modules with record named message
.
E.g.
Messages will be Payment.message
and attached enums become Payment.state
Yes I can see the potential for conflict and how modules would prevent it. Other solution could include a clever detection of conflict and generating a different name... the problem with the module is that the generated code become heavier to read and not sure how to handle recursive data types
the problem with the module is that the generated code become heavier to read and not sure how to handle recursive data types
I've started to realize that as well. Your code becomes much more verbose cause you have to import every type that you are trying to use, instead of being able to just import protobuf types.
I think if we use a name splitter that goes against the convention of protobuf naming style, maybe we can get away with it.
Other solution could include a clever detection of conflict and generating a different name
The only thing I see with this is how do you then tell which name corresponds to which type without having to read the source file over and over again.
Sample Proto File
Generates following types.ml
causing type error