Skip to content

Implicit any with overloaded function taking function-returning callback #17586

@ghost

Description

TypeScript Version: nightly (Version 2.5.0-dev.20170801)

Code

declare function f(n: number): void;
declare function f(cb: () => (n: number) => number): void;

f(() => n => n + 1);

Expected behavior:

No error.

Actual behavior:

src/a.ts(4,9): error TS7006: Parameter 'n' implicitly has an 'any' type.

There is no error if I remove the first overload of f.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions