Skip to content

Make functions generic when contextually typed by a generic signature #5737

@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd
type Foo = (one: string) => number;

function fooOver() : Foo {
    return one => parseInt(one); // <-- one is string
}

type Bar = <a>(one: string) => a;

function barOver() : Bar {
    return one => parseInt(one); // <-- one is god knows what
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions