-
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
String Literal Type does not work #20271
Comments
This is working as intended. The argument in the call to It works if you add a type annotation (thus providing a contextual type): let obj: TypeA = {
test: "test1"
}; Duplicate of #17363 and others. For a discussion of the widening rules see #10676. |
Thanks for your promoting reply. |
TypeScript Version: 2.7.0-dev.201xxxxx
Code
Expected behavior:
Check pass
Actual behavior:
I get a TS2345
The text was updated successfully, but these errors were encountered: