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

dlaberge picture dlaberge  路  3Comments

Antony-Jones picture Antony-Jones  路  3Comments

zhuravlikjb picture zhuravlikjb  路  3Comments

Zlatkovsky picture Zlatkovsky  路  3Comments

blendsdk picture blendsdk  路  3Comments