You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
imagine that we try to create a struct with a field called pub:
structThing{pub:Field}
this won't work as pub is a reserved keyword:
Error: × Looks like something went wrong in parser
╭─[tmp/src/main.no:3:1]
3 │ struct Thing {
4 │ pub: Field
· ─┬─
· ╰── here
5 │ }
╰────
help: invalid token, expected: a lowercase alphanumeric (including
underscore) string starting with a letter
The problem here is that the error doesn't help us understand why pub doesn't work. It would be good to write what we got instead.
Perhaps this can be done everywhere by also including the obtained token in the error? So something like this:
imagine that we try to create a struct with a field called
pub
:this won't work as
pub
is a reserved keyword:The problem here is that the error doesn't help us understand why
pub
doesn't work. It would be good to write what we got instead.Perhaps this can be done everywhere by also including the obtained token in the error? So something like this:
could become
for example
The text was updated successfully, but these errors were encountered: