Skip to content

Can't use implements with an unnamed class expression without using extends #4584

@weswigham

Description

@weswigham
interface Foo {
    doThing(): void;
}

let cls = class implements Foo {
    doThing() { }
};

TS errors on this because it thinks implements is supposed to be the class name for the class expression, rather than the start of an implements clause.
This is fine, however:

let cls = class extends null implements Foo {
    doThing() { }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions