Closed
Description
Search terms
NoInfer, TypeScript 5.4
Expected Behavior
When NoInfer<T>
is used in a function parameter, T
is retained in the document output of this function parameter. This is because T
is still informational, indicating that the function parameter has type T
-- it's just that T
can't be inferred from this function parameter.
Actual Behavior
T
is removed from this function parameter in the doc.
Steps to reproduce the bug
(The corresponding test does not check for C
:
typedoc/src/test/behavior.c2.test.ts
Line 1180 in 3398e98
- Download the test file: https://github.com/TypeStrong/typedoc/blob/3398e98dce4de5d7c5a53f1f6c66e1af8aa28cc9/src/test/converter2/behavior/noInfer.ts
export function createStreetLight<C extends string>(
colors: C[],
defaultColor?: NoInfer<C>,
) {}
// @ts-expect-error
createStreetLight(["red", "yellow", "green"], "blue");
npm install --save-dev typedoc
npx typedoc NoInfer.ts
- Observe that
C
is gone from thedefaultColor
parameter description
Environment
- Typedoc version: 0.25.12
- TypeScript version: 5.4.3
- Node.js version: 20.12.1
- OS: Debian
Metadata
Metadata
Assignees
Labels
No labels