-
Notifications
You must be signed in to change notification settings - Fork 708
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
Interface and Class with same name leeds to endless loop #2495
Labels
bug
Functionality does not match expectation
Comments
Can confirm, I am seeing the same behaviour. MRE: // index.ts
interface IAnimal {
name: number;
}
interface IFish extends IAnimal {
maxDepth: number;
}
class IFish implements IFish {} Result: $ npx typedoc index.ts
TypeDoc exiting with unexpected error:
RangeError: Maximum call stack size exceeded
at fullHierarchy (/home/me/fishProject/node_modules/typedoc/dist/lib/output/themes/default/templates/hierarchy.js:11:21)
at /home/me/fishProject/node_modules/typedoc/dist/lib/output/themes/default/templates/hierarchy.js:17:44
at Array.map (<anonymous>)
at fullHierarchy (/home/me/fishProject/node_modules/typedoc/dist/lib/output/themes/default/templates/hierarchy.js:16:33)
at /home/me/fishProject/node_modules/typedoc/dist/lib/output/themes/default/templates/hierarchy.js:17:44
at Array.map (<anonymous>)
at fullHierarchy (/home/me/fishProject/node_modules/typedoc/dist/lib/output/themes/default/templates/hierarchy.js:16:33)
at /home/me/fishProject/node_modules/typedoc/dist/lib/output/themes/default/templates/hierarchy.js:17:44
at Array.map (<anonymous>)
at fullHierarchy (/home/me/fishProject/node_modules/typedoc/dist/lib/output/themes/default/templates/hierarchy.js:16:33) Unfortunately, I do not really know the purpose of such structures, but they exist (probably legacy code) and cause the issue mentioned above. |
Huh, I guess that's valid TS... didn't think I had to worry about infinite loops when dealing with inheritance. |
This was referenced Jul 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search terms
Expected Behavior
no crash
Actual Behavior
Steps to reproduce the bug
The above example might look strange. Like this, the class
Foo
does not need to implement all the properties of interfaceFoo
. 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
The text was updated successfully, but these errors were encountered: