-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
String enum computed values not allowed #20440
Comments
Should be addressed by #18887 |
@andy-ms Is it still going to be fixed? #18887 suggests that only conflicts needs to be resolved? |
#18887 was automatically closed due to inactivity, is this going to fixed? |
This is disallowed on purpose. String enums are syntactically differentiated from numeric enums by having string literals in all initialization positions. It's also the case that we need to produce a union type (instead of a branded primitive type) for a string literal enum, which aren't really sourced from consts without explicit type annotations. |
TypeScript Version: 2.7.0-dev.201xxxxx
Code
As mentioned earlier by @MadaraUchiha and others, why can we do the following?
But not:
It should be either both are valid, or none, this looks like an inconsistency in Typescript.
The text was updated successfully, but these errors were encountered: