Skip to content

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

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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