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

Maximum call stack exceeded when using recursive types #1547

Closed
pyoor opened this issue Mar 22, 2021 · 1 comment
Closed

Maximum call stack exceeded when using recursive types #1547

pyoor opened this issue Mar 22, 2021 · 1 comment
Labels
bug Functionality does not match expectation

Comments

@pyoor
Copy link

pyoor commented Mar 22, 2021

Search terms

maximum call stack recursive

Expected Behavior

Typedoc should be able to generate documentation for recursive types.

Actual Behavior

Typedoc raises a maximum call stack error when attempting to generate documentation for recursive types.

Steps to reproduce the bug

The following is a minimal example that can be used to reproduce this issue:

export interface ThingA {
    type: "ThingA"
}

export interface ThingB {
    type: "ThingB"
}

type Things =
    ThingA
    | ThingB

type ValueOrArray<T> = T | Array<ValueOrArray<T>>

/**
 * Test.
 */
export class Test {
    /**
     * Log a thing.
     *
     * @param things - Array of things or a thing.
     */
    log_thing(things: ValueOrArray<Things>): void {
        console.log(things)
    }
}

Environment

  • Typedoc version: 0.20.33
  • TypeScript version: 4.2.3
  • Node.js version: 14.16.0
  • OS: Ubuntu 20.04
@pyoor pyoor added the bug Functionality does not match expectation label Mar 22, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 25, 2021

Thanks for the reproduction! I love single file repros :) This is a somewhat annoying one.. not sure why it's broken at first glance. I thought TS 4.2's check would let us resolve this, but apparently not since it has a type parameter...

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

2 participants