Skip to content

Argument becomes implicit any when a void-returning overload follows a non-void-returning signatureΒ #48088

Open
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Bug Report

πŸ”Ž Search Terms

overload argument type signature

πŸ•— Version & Regression Information

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

declare const it: {
    (test: () => Promise<void>): void;
    (test: (input: string) => void): void;
}

it((input) => {
    input.toUpperCase();
});

it(async () => {
    // ..
});

πŸ™ Actual behavior

Error: Parameter 'input' implicitly has an 'any' type.

πŸ™‚ Expected behavior

No type error. The input parameter is type string and should be resolved as such.

For more context, see DefinitelyTyped/DefinitelyTyped#59075.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions