Skip to content

Error message for use of a keyword in ident position could be tweaked #15358

Closed
@sschepens

Description

@sschepens

In the example below, the error message could at least mention that type is keyword, or be changed more radically: #15358 (comment)

Previously:

Cannot declare a field 'type' on struct

Declaring for example the following struct:

struct Serie {
  metric: String,
  type: String
}

Yields the following error:

error: found `type` in ident position
type: String

Is this intended?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions