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
该页”类型断言的限制“里相同的代码已经说了两者相互兼容,为何下面就不兼容了?
The text was updated successfully, but these errors were encountered:
animal as cat ,cat as animal不代表两者互相兼容。只是animal兼容cat,所以animal可以断言为cat,cat可以断言为animal。而声明只能是cat声明为animal。 即动物不一定是猫,猫一定是动物。猫一定是动物这句话将猫转为动物,就是let tom: animal= cat; 而断言则多了一种情况,即我通过它的一系列行为(代码逻辑)断言这个动物一定是猫。
Sorry, something went wrong.
只有一样的东西才互相兼容
No branches or pull requests
该页”类型断言的限制“里相同的代码已经说了两者相互兼容,为何下面就不兼容了?
The text was updated successfully, but these errors were encountered: