Skip to content

No error when interface declares a function and property with same name and return type #16214

@mattmccutchen

Description

@mattmccutchen

TypeScript Version: 2.3.4 (same in 2.4.0-dev.20170601)

Code

interface Oops {
  foo(x: string): number;
  foo: number;
}

Expected behavior:
error TS2300: Duplicate identifier 'foo'.

Actual behavior:
No error.

I bisected using the NPM nightly builds (I ran into build problems trying to bisect from source), and this broke between 1.9.0-dev.20160524-1.0 and 1.9.0-dev.20160525-1.0. I suspect #8696.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions