Skip to content

Generics return type check with arrow functions #13631

@zerkms

Description

@zerkms

TypeScript Version: playground (2.1.4-insiders.20161201)

Code

let f1: <T>(a: T) => T = a => 42;

function f2<T>(a: T): T {
    return 42;
};

Expected behavior:

Since those functions are identical I expect both to behave the same: to fail the type check.

Actual behavior:

The f1 type checks fine.

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