Skip to content

why number can be assigned to enum variable? #43806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rainmanhhh opened this issue Apr 24, 2021 · 1 comment
Closed

why number can be assigned to enum variable? #43806

rainmanhhh opened this issue Apr 24, 2021 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@rainmanhhh
Copy link

enum E {
  a = 1,
  b = 2
}

const c: E = 3 // no compile error
@whzx5byb
Copy link

Related: #26362

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants