Skip to content

noImplicitAny and generic arrow functions misbehave #13632

@zerkms

Description

@zerkms

TypeScript Version: playground (2.1.4-insiders.20161201)

Code

The following code should be run with the noImplicitAny set:

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

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

Expected behavior:

Both functions should compile fine.

Actual behavior:

The f1 arrow function fails the type check as the compiler thinks a is of any type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design LimitationConstraints of the existing architecture prevent this from being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions