-
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
Improper usage of properties with missing set / get should be an error #295
Comments
It certainly would be nice. The biggest problem here is that getter/setter and properties are not differentiated at the type level. That is, the .d.ts for the above type is:
so obviously you now can't do any of these kinds of checks unless you have the full implementation to inspect. If we did #12 then this kind of checking would likely fall out of that nicely so I'm just going to close this. |
I just ran into this very same bug. If there is no setter for a property, then an error should be flagged (or at least a warning). |
Yep, I still hit this error times and times again (especially in TypeScript code written by people that start using the language right away without looking into it deeply). " it compiles, so it should just work" this is what they say... |
If a property has a getter but no setter (or vice versa) than perhaps the attempt to set or get should be flagged as an error:
No biggie. But something to be aware of. (ported from http://typescript.codeplex.com/workitem/834)
The text was updated successfully, but these errors were encountered: