Typedoc: Class constructor is labeled as inherited even if it's not

Created on 7 Mar 2021  路  4Comments  路  Source: TypeStrong/typedoc

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.

https://user-images.githubusercontent.com/7217420/110241955-01da5b80-7f54-11eb-82a2-bbdd29d6927b.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
bug reproduced

Most helpful comment

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.

All 4 comments

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()
    // ...
  }
}

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings