Skip to content

Interface and Class with same name leeds to endless loop #2495

Closed
@besessener

Description

@besessener

Search terms

  • RangeError: Maximum call stack size exceeded
  • interface and claas that implements it ith same name

Expected Behavior

no crash

Actual Behavior

TypeDoc exiting with unexpected error:
RangeError: Maximum call stack size exceeded
    at ProjectReflection.getReflectionById (C:\Repos\Claas\cde-fe-app\node_modules\typedoc\dist\lib\models\reflections\project.js:193:22)
    at get reflection [as reflection] (C:\Repos\Claas\cde-fe-app\node_modules\typedoc\dist\lib\models\types.js:678:35)
    at C:\Repos\Claas\cde-fe-app\node_modules\typedoc\dist\lib\output\themes\default\templates\hierarchy.js:17:30
    at Array.map (<anonymous>)
    at fullHierarchy (C:\Repos\Claas\cde-fe-app\node_modules\typedoc\dist\lib\output\themes\default\templates\hierarchy.js:16:33)
    at C:\Repos\Claas\cde-fe-app\node_modules\typedoc\dist\lib\output\themes\default\templates\hierarchy.js:17:44
    at Array.map (<anonymous>)
    at fullHierarchy (C:\Repos\Claas\cde-fe-app\node_modules\typedoc\dist\lib\output\themes\default\templates\hierarchy.js:16:33)
    at C:\Repos\Claas\cde-fe-app\node_modules\typedoc\dist\lib\output\themes\default\templates\hierarchy.js:17:44
    at Array.map (<anonymous>)

Steps to reproduce the bug

export interface Foo {
  type?: string;
  name?: string;
  id: string;
  hidden?: boolean;
}

export class Foo extends Serializable implements Foo {
  constructor(params: Foo) {
    super(params);
  }
}

The above example might look strange. Like this, the class Foo does not need to implement all the properties of interface Foo. The properties are just there (Mixin).

My assumption is, that this code leads to an endless loop.....or actually endless recursion of function function fullHierarchy(context, root)

Environment

  • Typedoc version: 0.25.7
  • TypeScript version: 5.1.6
  • Node.js version: 21.6.1
  • OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions