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 type arguments should be omitted from documentation #2820

Closed
hoodmane opened this issue Dec 24, 2024 · 1 comment
Closed

Default type arguments should be omitted from documentation #2820

hoodmane opened this issue Dec 24, 2024 · 1 comment
Labels
bug Functionality does not match expectation

Comments

@hoodmane
Copy link

Expected Behavior

If a type has a type argument and we use the default value for it, the type argument should not appear in the documentation.

Actual Behavior

Sometimes the type argument appears, sometimes it doesn't. It seems that Iterator<number> as a return type is rendered as Iterator<number> but as a parameter type is rendered as Iterator<number, any, undefined>.

Steps to reproduce the bug

I use Uint8Array for the repro because it is always present independent of the "lib" compiler option. Uint8Array just gained a type parameter in typescript 5.7 so this particular reproducer doesn't work in prior versions but it will reproduce with Iterator.

npm i typedoc@0.27 typescript@5.7
cat << 'END' > a.ts
export function f(a: Uint8Array): Uint8Array {
    return a;
}
END
npx typedoc a.ts

Output looks like:
image

Environment

  • Typedoc version: 0.27.5
  • TypeScript version: 5.7.1
  • Node.js version: 22.12
  • OS: ubuntu 22.04
@hoodmane hoodmane added the bug Functionality does not match expectation label Dec 24, 2024
@hoodmane
Copy link
Author

Thanks for the fast fix @Gerrit0!

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

No branches or pull requests

1 participant