-
Notifications
You must be signed in to change notification settings - Fork 40
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
fix: type shadowing in proto file #481
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good!
I am not sure I understand why this error is happening though. What is shadowing "account.AccountInfo"? As far as I can tell, there is nothing special about this reference as compared to other references in the same file.
The
From what I understood, the first name is overwriting (also called shadowing) the second name in this case, so the type This name collision doesn't happen in the other messages and that's why it's only needed here. |
Ah! Thank you! So, if we renamed the field to something like |
Yes, that would also work but the name should also be changed in the code in that case. I just looked into it and it's not that much different, maybe we prefer the name change instead of the explicit root. |
I'm fine either way. |
5bac7a8
to
ed3ba1b
Compare
At the end I decided to change the name and keep the type definition consistent. |
ed3ba1b
to
571830d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you! Could you also update the changelog since now this is a breaking change?
* fix: change field name in `GetAccountDetailsResponse` * update: CHANGELOG
When updating the dependencies in the client we started getting this error when generating the rust types from proto files:
It seems the name of the field
account
is shadowing the name of the importaccount
. As it is recommended in the message, this can be fixed by specifying the root.