Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Arrow functions should not have a 'prototype' property #1761

Closed
DanielRosenwasser opened this issue Jan 21, 2015 · 3 comments
Closed

Arrow functions should not have a 'prototype' property #1761

DanielRosenwasser opened this issue Jan 21, 2015 · 3 comments
Labels
Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Milestone

Comments

@DanielRosenwasser
Copy link
Member

function f() {
    var a = () => 5;
    return a.prototype;
}

We should give an error here.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Breaking Change Would introduce errors in existing code labels Jan 21, 2015
@RyanCavanaugh
Copy link
Member

I think we have no way to do this? The apparent type of a callable type includes the members from the global type Function and we can't really remove prototype from that declaration.

@mhegazy
Copy link
Contributor

mhegazy commented Jan 21, 2015

The only way would be to have lambda functions have a different apparent type from regular functions.

@mhegazy mhegazy added this to the TypeScript 2.0 milestone Jan 22, 2015
@mhegazy mhegazy modified the milestones: TypeScript 2.0, TypeScript 1.8 Dec 1, 2015
@mhegazy mhegazy self-assigned this Dec 1, 2015
@mhegazy mhegazy added the ES6 Relates to the ES6 Spec label Feb 22, 2016
@mhegazy mhegazy modified the milestones: TypeScript 2.1, Future Sep 29, 2016
@RyanCavanaugh RyanCavanaugh added the Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it label Mar 11, 2019
@RyanCavanaugh RyanCavanaugh removed Breaking Change Would introduce errors in existing code Bug A bug in TypeScript ES6 Relates to the ES6 Spec labels Mar 11, 2019
@RyanCavanaugh
Copy link
Member

No one else has noticed in 4 years

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Projects
None yet
Development

No branches or pull requests

3 participants