Skip to content
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

Suggestion: output fewer errors for incorrectly implemented interface #10077

Open
ghost opened this issue Aug 1, 2016 · 1 comment
Open

Suggestion: output fewer errors for incorrectly implemented interface #10077

ghost opened this issue Aug 1, 2016 · 1 comment
Labels
Effort: Difficult Good luck. Help Wanted You can do this Suggestion An idea for TypeScript
Milestone

Comments

@ghost
Copy link

ghost commented Aug 1, 2016

TypeScript Version: nightly

Code

interface A {
    f(): void;
}
class B implements A {
    eff() {}
}

var b: B;
b.f();
b.f();
b.f();

Expected behavior:

src/a.ts(4,7): error TS2420: Class 'B' incorrectly implements interface 'A'.
  Property 'f' is missing in type 'B'.

Actual behavior:

src/a.ts(4,7): error TS2420: Class 'B' incorrectly implements interface 'A'.
  Property 'f' is missing in type 'B'.
src/a.ts(9,3): error TS2339: Property 'f' does not exist on type 'B'.
src/a.ts(10,3): error TS2339: Property 'f' does not exist on type 'B'.
src/a.ts(11,3): error TS2339: Property 'f' does not exist on type 'B'.

There can be an overwhelming number of missing-property errors if a commonly-used class mis-implements an interface it declares.

@ghost ghost added the Suggestion An idea for TypeScript label Aug 1, 2016
@RyanCavanaugh RyanCavanaugh added the In Discussion Not yet reached consensus label Aug 1, 2016
@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Effort: Difficult Good luck. and removed In Discussion Not yet reached consensus labels Aug 22, 2016
@RyanCavanaugh RyanCavanaugh added this to the Community milestone Aug 22, 2016
@RyanCavanaugh
Copy link
Member

Accepting PRs if and only if this can be done very simply/cheaply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Effort: Difficult Good luck. Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

1 participant