Typescript: Arrow functions should not have a 'prototype' property

Created on 21 Jan 2015  ·  3Comments  ·  Source: microsoft/TypeScript

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

We should give an error here.

Won't Fix

Most helpful comment

No one else has noticed in 4 years

All 3 comments

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.

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

No one else has noticed in 4 years

Was this page helpful?
0 / 5 - 0 ratings

Related issues

weswigham picture weswigham  ·  3Comments

CyrusNajmabadi picture CyrusNajmabadi  ·  3Comments

kyasbal-1994 picture kyasbal-1994  ·  3Comments

bgrieder picture bgrieder  ·  3Comments

Roam-Cooper picture Roam-Cooper  ·  3Comments