Closed tomyrd closed 4 weeks ago
The account
name is used in two places in this context:
GetAccountDetailsResponse
AccountInfo
From what I understood, the first name is overwriting (also called shadowing) the second name in this case, so the type AccountInfo
is being searched inside the field when it should be searched inside the module. By specifying the root with the '.' we are removing this ambiguity and the type will be searched in .account.AccountInfo
.
This name collision doesn't happen in the other messages and that's why it's only needed here.
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 details
, it would solve the problem as well, right? (not that we should do it, but just wanted to confirm)
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 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.
At the end I decided to change the name and keep the type definition consistent.
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.