Skip to content

Infer implementation signature based on overload signatures #14972

Description

@vilicvane

Probably a duplicate, but I cannot find one.

function foo(p1: string): void;
function foo(p1: number, p2: boolean): void;
function foo(p1, p2) {
    // p1: string | number;
    // p2: boolean | undefined;
}

If there could be constraints among parameters via type guards, it would be awesome.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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