-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
impl ::prost::Message
for a struct shadows the user-defined type
#1042
Comments
So because you generate an enum B and there is a generic type B, there is a conflict. The simplest solution seems to change the generated function signature to: |
Yes, the solution makes sense, I'll make a PR with these changes. |
@caspermeijn note, I also changed the generated functions for enums ( |
* Change generated functions signatures to remove type parameters; fixes #1042 * Add test to confirm no type shadowing * Change generated functions signatures to remove type parameters (rest of ::prost::Message trait) * Change functions signatures to avoid generic type parameters
Minimal protobuf file to reproduce:
Problem is that generated
impl ::prost::Message for A
contains a generic type parameter for a number of functions, that shadows theB
enum:The error message from the compiler, that is not clear:
There are at least two possible solutions:
<ImplProstBytesBufMut>
instead of<B>
);Probably, there are some other similar issues that are not noticed yet.
The text was updated successfully, but these errors were encountered: