We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I wish I could turn duck-typing off sometimes because it leads to bugs that very hard to detect.
For example: Suppose I have 2 interfaces with the same surface but completely unrelated sematics:
interface Chicken { id: number; name: string; } interface JetPlane { id: number; name: string; }
then doing the following is completely fine in TypeScript:
var chicken : Chicken = { id: 1, name: 'Thomas' }; var plane: JetPlane = { id: 2, name: 'F 35' }; chicken = plane;
I wish there was an option to prevent such assignment from being valid.
The text was updated successfully, but these errors were encountered:
This is a duplicate of #202.
Sorry, something went wrong.
Agreed
No branches or pull requests
I wish I could turn duck-typing off sometimes because it leads to bugs that very hard to detect.
For example:
Suppose I have 2 interfaces with the same surface but completely unrelated sematics:
then doing the following is completely fine in TypeScript:
I wish there was an option to prevent such assignment from being valid.
The text was updated successfully, but these errors were encountered: