-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
No error on object literal containing property of wrong type for union #22129
Comments
Looks like a duplicate of #20863 |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
According to #20863 (comment), this is not a duplicate. Could it be reopened? |
Probably the error is that the object provided is assignable to |
I believe the comment in #20863 (comment) is not right. this is a duplicate of #20863. |
TypeScript Version: 2.6.2, 2.7.2, 2.8.0-dev.20180222
Search Terms:
Code
Expected behavior:
I would expect to get this type of error:
Actual behavior:
No error. I would guess that the object literal is being inferred as a
B
with an extraneousz
property instead of aC
, however I would expect the rule about object literals not containing extraneous properties to apply. And what's odder is that ifx
isn't specified it does give the expected error:Playground Link
The text was updated successfully, but these errors were encountered: