Skip to content

lib.d.ts contains wrong typings for Number.isFinite() #15527

Closed
@rogierschouten

Description

@rogierschouten

I'm not sure whether this is the repo to be putting this issue on, please let me know if it isn't.

TypeScript Version: 2.2.2

Code
Compiling with strict null checks:

 Number.isFinite(undefined);

Expected behavior:

No compile error. The argument to isFinite should be any, because the function is used to check the type. According to the spec at https://www.ecma-international.org/ecma-262/6.0/#sec-number.isfinite the type is checked by the function.

Actual behavior:

error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'number'

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions