Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mattmccutchen opened this issue Jun 2, 2017 · 1 comment
Labels
Bug A bug in TypeScript Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@mattmccutchen
Copy link
Contributor

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.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jun 5, 2017
@mhegazy mhegazy added Help Wanted You can do this Good First Issue Well scoped, documented and has the green light labels Feb 8, 2018
@mhegazy mhegazy added this to the Community milestone Feb 8, 2018
@mattmccutchen
Copy link
Contributor Author

Duplicate of #20826.

@mhegazy mhegazy removed this from the Community milestone Apr 26, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants