-
Notifications
You must be signed in to change notification settings - Fork 42
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
Change all type aliases to type definitions #207
Comments
Hey @samlaf can I take up this issue? |
yes sir |
Hey @samlaf , I see that it is still not resolved. Can I contribute to it? And do I need to change all the type alias to the actual datatypes? |
There’s a PR open for it, I haven’t had time to review it though :/ |
We shouldn't have used type aliases in types (see for example OperatorId). See quote below.
Problem it creates is that when another pkg uses the sdk and calls a function which returns an Aliased type, vscode (and probably other editors?) show the returned type as the underneath type definition (instead of the type alias name).
So for eg getOperatorsAvsStateAtBlock will show
instead of its actual definition in the sdk as
Note the key type is Bytes32 instead of OperatorId, so it lost its semantics.
From https://yourbasic.org/golang/type-alias/ (and see the linked https://go.dev/talks/2016/refactor.article)
The text was updated successfully, but these errors were encountered: