Skip to content

TypeScript v5 missing typeArguments with default generics #2213

Closed as not planned
Closed as not planned
@Shinigami92

Description

@Shinigami92

Search terms

  • typeArguments
  • generics
  • TypeScript v5

Expected Behavior

We have defined a type:

// ./types.ts
export type LiteralUnion<T extends U, U = string> =
  | T
  | (U & { zz_IGNORE_ME?: never });

// ./index.ts
export type Test = LiteralUnion<'a' | 'b'>;

TypeScript v4.x produced

type.typeArguments[0] -> "'a' | 'b'"
type.typeArguments[1] -> "string"

image

Actual Behavior

TypeScript v5.x produced

type.typeArguments[0] -> "'a' | 'b'"

Steps to reproduce the bug

Repro: TypeStrong/typedoc-repros#27

Relevant issue: faker-js/faker#1953

Environment

  • Typedoc version: 0.24.0-beta.7 | 0.23
  • TypeScript version: v5.0.2
  • Node.js version: 18
  • OS: mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixDeclining to implement

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions