Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMore path suggestions for when a struct field doesn't exist #2472
Comments
Nokel81
changed the title
More path options for struct fields don't exist
More path suggestions for when a struct field doesn't exist
Jun 12, 2018
Centril
added
the
T-lang
label
Jun 12, 2018
This comment has been minimized.
This comment has been minimized.
|
I highly recommend taking this to the internals forum instead if you want more eyes on it :) |
Centril
closed this
Jun 13, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nokel81 commentedJun 12, 2018
See this playground:
Currently, if someone tries to reference a field that doesn't exist in the current struct an error is produced and recommendations are provided, this is wonderful.
However, I think that it could be made even better by adding some addition suggestions. What would these be?
Referring back to my first example I would say that having
'state.tokens'in addition to the other names would be beneficial. To do this, if this error comes up then the the tree which is the name paths of the fields of each of the structs is traversed in order to find these additional suggestions.Caveats: