Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.

Override reports error when not all intermediate classes implement method #156

Open
HaKr opened this issue Dec 20, 2019 · 0 comments
Open

Comments

@HaKr
Copy link

HaKr commented Dec 20, 2019

The documentation states:

Checks that the marked method indeed overrides a function with the same signature somewhere on the prototype chain.

Yet, a syntax error gets thrown when an overridden method does not appear in all ancestors.

SyntaxError: No descriptor matching C#one() was found on the prototype chain.
Did you mean "one"?

class A {
   public one() { return 1; }
}

class B extends A {
   // Syntax error disappears when the line below is included  
   // public one() { return super.one(); }

   public two(y: number) { return y + this.one(); }
}

class C extends B {
   @override
   public one() { return 42; }
}

const c = new C();
console.log(c.two(2));

Looks related to #62

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant