Vague error message when using generics #71924
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I received the following error while working on an Amethyst project;
After scratching my head for a while and searching the Amethyst Discord, and finally StackOverflow, I realized I was having a brainfart and the type I was using was a generic and I wasn't fully defining it. I had been having some trouble getting an import to work successfully, so I was unsure if the type was even successfully being added to my namespace in the first place, which left me completely confused as to how to interpret this error. Was the compiler telling me 'TileMap' is not a type..??
This error does not seem in line with the level of explicitness of most of the first-pass compiler errors, and does not contain any resolution suggestions. At least one past issue exists about this particular type of error and several stackoverflow threads exist asking, essentially, 'What does this error mean?' (with successful resolutions of the form, 'That's a generic type with missing type parameters') which seems like a good indicator that the error could be more helpful and explicit. (e.g. 'This generic type is expecting _ type parameters but only found _')
This issue has been assigned to @Patryk27 via this comment.
The text was updated successfully, but these errors were encountered: