Skip to content

enum with bigger integer than available is allowed #8020

Closed
@donaldpipowitch

Description

@donaldpipowitch

Code

export enum ModelType {
  Repositories,
  Gists
};

function test(modelType: ModelType) {

}

test(2);

Example
Expected behavior:

Throw error, because 2 shouldn't be available in ModelType.

Actual behavior:

No error is thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions