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