-
Notifications
You must be signed in to change notification settings - Fork 278
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
断言函数用于函数表达式时,ts 报错, #119
Comments
网上有一些说法是:为了确保类型断言函数在使用箭头函数定义时能够正确工作,我们需要确保类型断言函数的定义包含显式的类型注解。并给出下面的解决方案,报错依然存在 const n: unknown = 1;
assertIsNumber(n) |
参考 microsoft/TypeScript#33622 (comment) ,删除写法一。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
文档地址
tsconfig.json
("typescript": "^5.6.2")The text was updated successfully, but these errors were encountered: