Typedoc: Default values for type parameters are not used as type arguments

Created on 4 Aug 2020  路  2Comments  路  Source: TypeStrong/typedoc

Search terms


type-parameters, type-arguments

Expected Behavior

Default values for type parameters are used as type arguments.

Actual Behavior

When a class is extending the binding of a template class with some type parameters getting no type arguments, the default values for those type parameters are not used and instead the type parameters are shown on the page of the class, which makes the class look generic while it isn't.

Example:

````typescript
class TemplateClass {
}

class ConreteClass extends TemplateClass {
}
````

Results in a typedoc page for ConreteClass where ConreteClass has a type parameter B, instead of it being derived from TemplateClass<string, any>.

Steps to reproduce the bug

Create the documentation for the code above.

Environment

  • Typedoc version: 0.17.8
  • TypeScript version: 3.9.6
  • Node.js version: 12.13.0
  • OS: Windows 10 (64-bit)

Most helpful comment

I started working on this and things are looking good in my small test project. Will have to test the changes on a bigger React project though.

I will also have to adapt the tests as some of them are now failing.

All 2 comments

I started working on this and things are looking good in my small test project. Will have to test the changes on a bigger React project though.

I will also have to adapt the tests as some of them are now failing.

I realized that there are several bugs involved here so I moved parts of the original issue to #1345.

Was this page helpful?
0 / 5 - 0 ratings