Skip to content

Merged Interfaces with incompatible methods and properties should be an error #20826

@weswigham

Description

@weswigham

TypeScript Version: 2.7.0-dev.201xxxxx

Code

interface Foo {
    bold(): string;
}

interface Foo {
    bold: string;
}

var x: Foo;

const j = x.bold;

Expected behavior:
j is type any, TS issues an error on both declarations of bold because their type doesn't match.

Actual behavior:
No error, j is type string.

Please note, the colors DT package (and one other package) relies on our current buggy behavior here and will need to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions