🔎 Search Terms
RangeError: Maximum call stack size exceeded
getNameOfSymbolAsWritten crash
symbolToTypeNode recursion
ReturnType indexed access crash
🕗 Version & Regression Information
Versions tested: 5.7.3, 5.8.3, 5.9.3, Nightly, TS7.
⏯ Playground Link
https://www.typescriptlang.org/zh/play/?target=7&ts=6.0.0-dev.20260319#code/GYVwdgxgLglg9mABBANggpgCgJQC5EA8AKgHyZwBGAVvkdogLwmJGLoAeU6YAJgM6IAhmACeiAPyIASuiggATmCIiADugJRV6OMGRow6EgG0ADAF1E+EwG4gA
💻 Code
function clone(): <T>(obj: T) => T extends any ? ReturnType<typeof clone>[0] : 0;
🙁 Actual behavior
node built/local/tsc.js -noEmit functionOnlyHasThrow_filled_2_unvalidated_mutated_batch6.ts
D:\github\TypeScript\built\local\_tsc.js:123721
throw e;
^
RangeError: Maximum call stack size exceeded
at getTextOfNodeFromSourceText (D:\github\TypeScript\built\local\_tsc.js:13034:37)
at getSourceTextOfNodeFromSourceFile (D:\github\TypeScript\built\local\_tsc.js:13017:10)
at getTextOfNode (D:\github\TypeScript\built\local\_tsc.js:13045:10)
at declarationNameToString (D:\github\TypeScript\built\local\_tsc.js:13854:60)
at getNameOfSymbolAsWritten (D:\github\TypeScript\built\local\_tsc.js:55596:16)
at createAccessFromSymbolChain (D:\github\TypeScript\built\local\_tsc.js:53234:25)
at symbolToTypeNode (D:\github\TypeScript\built\local\_tsc.js:53211:26)
at typeToTypeNodeWorker (D:\github\TypeScript\built\local\_tsc.js:51561:18)
at typeToTypeNodeHelper (D:\github\TypeScript\built\local\_tsc.js:51342:24)
at conditionalTypeToTypeNode (D:\github\TypeScript\built\local\_tsc.js:51640:31)
Node.js v22.19.0
🙂 Expected behavior
The compiler should not crash.
Additional information about the issue
No response
🔎 Search Terms
RangeError: Maximum call stack size exceeded
getNameOfSymbolAsWritten crash
symbolToTypeNode recursion
ReturnType indexed access crash
🕗 Version & Regression Information
Versions tested: 5.7.3, 5.8.3, 5.9.3, Nightly, TS7.
⏯ Playground Link
https://www.typescriptlang.org/zh/play/?target=7&ts=6.0.0-dev.20260319#code/GYVwdgxgLglg9mABBANggpgCgJQC5EA8AKgHyZwBGAVvkdogLwmJGLoAeU6YAJgM6IAhmACeiAPyIASuiggATmCIiADugJRV6OMGRow6EgG0ADAF1E+EwG4gA
💻 Code
🙁 Actual behavior
🙂 Expected behavior
The compiler should not crash.
Additional information about the issue
No response