We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
enum, number
Playground link with relevant code
enum TypeA { A = 0, B = 1, C = 2, } const valueA1: TypeA = 4; // <-- no error const valueA2: TypeA = '4'; enum TypeB { A = '0', B = '1', C = '2', } const valueB1: TypeB = '4'; const valueB2: TypeB = 4;
The number can be assigned to an enum without errors.
Errors.
The text was updated successfully, but these errors were encountered:
Duplicate of #26362, which provides plenty of reasoning for this behaviour. Used search terms: enum number in:title
enum number in:title
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Bug Report
π Search Terms
enum, number
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The number can be assigned to an enum without errors.
π Expected behavior
Errors.
The text was updated successfully, but these errors were encountered: