Skip to content

[BUG] Generic parameters lost #555

Closed

Description

@rubenprins
Overview of the issue

Currently, the generic parameters for members are not shown properly. For example,

function something<T>(arg: T): T

gets documented as

function something(arg: undefined)

Also, generic parameters are erased from types. For example, Something<T> is documented as just Something. The type parameter T is mentioned as-is on the members, but it's not clear whether this is a type or type parameter).

Operating System, Node.js, npm, compodoc version(s)

Any OS, compodoc 1.1.2

Compodoc installed globally or locally ?

Locally

Motivation for or Use Case

We use generics extensively, which makes reading the documentation confusing at times.

Reproduce the error
class Something<T> {
  member: T;
}

function something<T>(arg: T): T {
  return arg;
}

Activity

  1. added this to the 1.1.3 milestone on May 6, 2018
  2. rubenprins commented on May 8, 2018

    @rubenprins
    Author

    @vogloblinsky Thank for the quick fix. Just one question, as I can't test it right now: would this fix also show the type parameters for classes & interfaces, or just for methods?

  3. vogloblinsky commented on May 8, 2018

    @vogloblinsky
    Contributor

    No but i can add it quickly, do you have examples ?

  4. rubenprins commented on May 8, 2018

    @rubenprins
    Author

    Just look at my sample under "Reproduce the error". The class Sample<T> canot be recognized as generic in the description or navigation.

    Not sure it makes sense to spell out the parameter names (they're not always a single letter), but indicating the arity should be enough I guess. So Foo<>, Foo<,>, etc. in navigation context should be enough.

  5. modified the milestones: 1.1.3, 1.1.4 on May 12, 2018
  6. modified the milestones: 1.1.4, 1.1.5 on Aug 24, 2018
  7. removed this from the 1.1.5 milestone on Oct 10, 2018
  8. 2 remaining items

  9. added this to the 1.1.9 milestone on Jan 29, 2019
  10. modified the milestones: 1.1.9, 1.2.0 on Mar 1, 2019
  11. vladjerca commented on May 23, 2019

    @vladjerca

    @vogloblinsky any update on this? I see the milestone was pushed a few times.

  12. stale commented on Sep 30, 2019

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  13. stale commented on Oct 7, 2019

    @stale

    This issue has been automatically closed because it has not had recent activity. Please file a new issue if you are encountering a similar or related problem. Thank you for your contributions.

  14. lock commented on Dec 6, 2019

    @lock

    This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

  15. locked as resolved and limited conversation to collaborators on Dec 6, 2019
  16. added a commit that references this issue on Oct 30, 2025
    db9167b
  17. added a commit that references this issue on May 25, 2026
    eb34354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions