Skip to content

When the function signatures of two interfaces are the same, they cannot be implemented at the same time #1855

Closed
@yjhmelody

Description

@yjhmelody
class A implements Foo, Bar {
    foo(): void {}
}

interface Foo {
    foo(): void;
}

interface Bar {
    foo(): void;
}

new A();
ERROR TS2394: This overload signature is not compatible with its implementation signature.

     foo(): void;
     ~~~~~~~~~~~
 in index.ts(12,5)

     foo(): void;
     ~~~~~~~~~~~
 in index.ts(8,5)

FAILURE 1 compile error(s)

This makes some of my interfaces unable to be reused, and even produces API conflicts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions