Skip to content

Report an error like TS2713 for enum members and provide a corresponding code fix #20358

Closed
@amcasey

Description

@amcasey
    enum Color {
        Red,
        Green,
        Blue
    }

    let a1: Color.Red.toString; // TS2694: The Namespace 'Color' has no exported member 'Red'
    let a2: Color.Red["toString"];

The type of a1 is invalid - it should be like the type of a2. It would be nice if the error indicated as much (which would also allow us to offer a code fix).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Error MessagesThe issue relates to error messagingGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do thisPursuitFellowshipHelp wanted from Pursuit fellowship; others please avoid until Dec 19SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions