You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
changed the title [-]Number check functions such as `isNaN` shouldn't have parameter type constraints[/-][+]Number check functions in the `Number` variable such as `isNaN` shouldn't have parameter type constraints as with global `isNaN`[/+]on Jun 9, 2017
changed the title [-]Number check functions in the `Number` variable such as `isNaN` shouldn't have parameter type constraints as with global `isNaN`[/-][+]Number check functions in the `Number` variable such as `isNaN` shouldn't constrain their parameter type as with global `isNaN`[/+]on Jun 10, 2017
While code like Number.isNaN("foo") technically won't crash, it won't accomplish anything either.
We also have errors for new Set<string>().has(0); and /rgx/.test(0);.
changed the title [-]Number check functions in the `Number` variable such as `isNaN` shouldn't constrain their parameter type as with global `isNaN`[/-][+]Number check functions such as `isNaN` shouldn't constrain their parameter type[/+]on Jun 10, 2017
Activity
[-]Number check functions such as `isNaN` shouldn't have parameter type constraints[/-][+]Number check functions in the `Number` variable such as `isNaN` shouldn't have parameter type constraints as with global `isNaN`[/+][-]Number check functions in the `Number` variable such as `isNaN` shouldn't have parameter type constraints as with global `isNaN`[/-][+]Number check functions in the `Number` variable such as `isNaN` shouldn't constrain their parameter type as with global `isNaN`[/+]ghost commentedon Jun 10, 2017
While code like
Number.isNaN("foo")
technically won't crash, it won't accomplish anything either.We also have errors for
new Set<string>().has(0);
and/rgx/.test(0);
.falsandtru commentedon Jun 10, 2017
For example, when we write compare function also working with
NaN
, we need the exact function detectingNaN
.I believe this code should be accepted.
falsandtru commentedon Jun 10, 2017
Sorry, I found global
isNaN
also constrains the parameter type. So I fix the code to:[-]Number check functions in the `Number` variable such as `isNaN` shouldn't constrain their parameter type as with global `isNaN`[/-][+]Number check functions such as `isNaN` shouldn't constrain their parameter type[/+]DanielRosenwasser commentedon Jun 10, 2017
Duplicate of #4002
Also see #15173 (comment)
falsandtru commentedon Jun 10, 2017
I searched it but probably I had some typo. Thanks.
DanielRosenwasser commentedon Jun 11, 2017
No worries! Sorry if that came off the wrong way, didn't mean to be abrasive.