Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generics return type check with arrow functions #13631

Closed
zerkms opened this issue Jan 23, 2017 · 1 comment
Closed

Generics return type check with arrow functions #13631

zerkms opened this issue Jan 23, 2017 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@zerkms
Copy link

zerkms commented Jan 23, 2017

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.

@mhegazy
Copy link
Contributor

mhegazy commented May 18, 2017

Duplicate of #5616

@mhegazy mhegazy added the Duplicate An existing issue was already created label May 18, 2017
@mhegazy mhegazy closed this as completed May 18, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants