Skip to content

Make the error generated by using tuple indexing on an array more specific. #53712

Closed
@Tom1380

Description

@Tom1380

Attempting to compile this:

let a = [100, 100];
a.0;

will give this error:

error[E0609]: no field `0` on type `[{integer}; 2]`

I was thinking that a clearer error could be something along the lines of:

error[E----]: attempting to use tuple indexing on an array.

and give this hint:

help: change this to `a[0]`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions