-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Exhausting enum values in switch statements without default case. #8618
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
Comments
Dupe of #2214? Currently planned for TS 2.1... |
@kitsonk IMO little bit different. That one is about types. My OP is about exhausting enum values. But anyway changed title and the content of my OP to reflect my intent. |
Hm, looks closer to #8602 actually. |
might be related #6155 |
Yes, dupe of #6155. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For expressivity I don't always include a default case in my switch statements. But I know that variable
abc
below cannot be any value other thana
,b
andc
. Thus, I think the below code should not error, because I return the correct type for all branches it can take.And for enums:
The text was updated successfully, but these errors were encountered: