-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Number check functions such as isNaN
shouldn't constrain their parameter type
#16427
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
Comments
isNaN
shouldn't have parameter type constraintsNumber
variable such as isNaN
shouldn't have parameter type constraints as with global isNaN
Number
variable such as isNaN
shouldn't have parameter type constraints as with global isNaN
Number
variable such as isNaN
shouldn't constrain their parameter type as with global isNaN
While code like |
For example, when we write compare function also working with var a: number | string = '';
[''].findIndex(b => a === b || Number.isNaN(a) && Number.isNaN(b)); I believe this code should be accepted. |
Sorry, I found global var a: number | string = '';
[''].findIndex(b => a === b || isNaN(a) && isNaN(b)); |
Number
variable such as isNaN
shouldn't constrain their parameter type as with global isNaN
isNaN
shouldn't constrain their parameter type
Duplicate of #4002 Also see #15173 (comment) |
I searched it but probably I had some typo. Thanks. |
No worries! Sorry if that came off the wrong way, didn't mean to be abrasive. |
TypeScript Version: master
Code
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: