Skip to content

why number can be assigned to enum variable? #43806

Closed
@rainmanhhh

Description

@rainmanhhh
enum E {
  a = 1,
  b = 2
}

const c: E = 3 // no compile error

Activity

whzx5byb

whzx5byb commented on Apr 24, 2021

@whzx5byb

Related: #26362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @whzx5byb@RyanCavanaugh@rainmanhhh

        Issue actions

          why number can be assigned to enum variable? · Issue #43806 · microsoft/TypeScript