Diagnostic for const with slice type should suggest converting to array type #102390
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-slice
Area: `[T]`
D-lack-of-suggestion
Diagnostics: Adding a (structured) suggestion would increase the quality of the diagnostic.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code (playground):
The current output is:
Ideally the output should make it clearer why this is an error, and suggest a fix:
Note that if I omit the type entirely (playground):
I do get an error message that suggests the correct array type:
The text was updated successfully, but these errors were encountered: