Skip to content

consider allowing exhaustive switch statement #6155

Closed
@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd
type foo = 'hey' | 'nay';
let value : foo = 'hey';
switch (value) {
    case 'hey': doThis(); break;
    case 'nay': doThat(); break;
    default: void; // <-- syntax TBD that indicates: 1. no other than known options are allowed 2. all known options must be considered
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions