-
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
Passing object with readonly fields to function expecting modifiable fields does not give a type error #11180
Comments
To avoid breaking every definition file in the world, the opposite of |
OK, I understand that backwards compatibility is important, but I do think that it limits the usefulness of |
we have talked about |
I would definitely love to see a |
@mhegazy would it be apropriate for me to open a suggestion for this? (I am obviously +1 on this ;) ) |
I have opened #11481 as a suggestion to add strictReadonlyChecks |
closing in favor of #11481 |
TypeScript Version: 2.0.3, 2.1.0-dev.20160927
Code
Expected behavior:
The call
modifyX(ro)
should give a type error, asro
has a readonly property but the interface tomodifyX
requires a modifiable field.Actual behavior:
No type error.
The text was updated successfully, but these errors were encountered: