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

Default values for type parameters are not used as type arguments #1341

Closed
krisztianb opened this issue Aug 4, 2020 · 2 comments · Fixed by #1348
Closed

Default values for type parameters are not used as type arguments #1341

krisztianb opened this issue Aug 4, 2020 · 2 comments · Fixed by #1348
Labels
bug Functionality does not match expectation

Comments

@krisztianb
Copy link
Contributor

krisztianb commented Aug 4, 2020

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:

class TemplateClass<A = {}, B = any> {
}

class ConreteClass extends TemplateClass<string> {
}

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)
@krisztianb krisztianb added the bug Functionality does not match expectation label Aug 4, 2020
@krisztianb
Copy link
Contributor Author

krisztianb commented Aug 7, 2020

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.

@krisztianb
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant