Skip to content

Function type union works unexpectedly #12404

Closed
@ethanresnick

Description

@ethanresnick

TypeScript Version: nightly (2.2.0-dev.20161121)

Code

declare const fn: (((...args: any[]) => any) | (() => boolean));

fn(1, 2, 3);

Expected behavior:
The call to fn(1, 2, 3) should succeed, as it should match the (...args: any[]) => any part of the union.

Actual behavior:

I get the error: "Supplied parameters do not match any signature of call target."

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