-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
typeof
does not get concatenated string type
#20676
Labels
Duplicate
An existing issue was already created
Comments
Duplicate of #12940 -- currently we never compute string literal types for concatenations. |
@andy-ms Thanks! Should I close this issue? |
I think so, you could add your use case as a comment to that issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The pattern I used in code below is originally from Redux. When I use strings "as is", without any concatenation, it works. But when I try to move common part (prefix) out, it brokes. Intuitively I assume that since prefix and other parts are constants
typeof
should get united type.TypeScript Version: 2.7.0-dev.20171213
Code
Expected behavior:
No errors raised.
Actual behavior:
Raises errors:
The text was updated successfully, but these errors were encountered: