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

Class constructor is labeled as inherited even if it's not #1528

Labels
bug Functionality does not match expectation

Comments

@marcofugaro
Copy link

Search terms

constructor, inherited, classes

Actual Behavior

If I have two classes, both with a constructor:

class RootClass {
  constructor() {
    // ...
  }
}

// ...

class ChildClass extends RootClass {
  constructor() {
    super()
    // ...
  }
}

In the ChildClass typedoc page, the constructor is marked as inherited even if it's not.

constructor.mov

Expected Behavior

The constructor should be marked as non-inherited, since the documentation shows is the one of the child class.

Environment

  • Typedoc version: 0.20.30
@marcofugaro marcofugaro added the bug Functionality does not match expectation label Mar 7, 2021
@thislooksfun
Copy link

I would actually argue that this is expected behavior since ChildClass's constructor has the same signature as RootClass it is technically overriding (and thus inheriting) that constructor. Unless this also happens if the constructors have different signatures (like below) I personally feel that this is working as intended.

class RootClass {
  constructor() {
    // ...
  }
}

// ...

class ChildClass extends RootClass {
  constructor(foo: string) {
    super()
    // ...
  }
}

@marcofugaro
Copy link
Author

@thislooksfun I didn't include it in the minimal example but yes, in my case the two constructors have a different signature.

@thislooksfun
Copy link

Ah, in that case yeah it's definitely a bug. Sorry to interject!

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 13, 2021

I hate every piece of code that I've written to solve this... but it works. Inheritance is the single most annoying piece of the converter right now, and mixins are the special case which makes everything so much worse.

This was referenced Mar 14, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment