microsoft / microsoft/TypeScript
RangeError: Maximum call stack size exceeded in getTypeFromTypeNode when resolving recursive tuple rest with intersection
Open
@ahejlsberg is already working on this.
Since Feb 3, 2026.
Bug
Domain: check: Type Circularity
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
🔎 Search Terms
RangeError: Maximum call stack size exceeded
getTypeFromTypeNode
getImpliedConstraint
Recursive tuple rest
Intersection type crash
🕗 Version & Regression Information
Crashes in 5.7.3, 5.8.3, 5.9.3, and Nightly.
⏯ Playground Link
💻 Code
type StringTreeArrayAsTuple<T> = (T extends [...infer R] ? [...StringTreeArrayAsTuple<R>] : never ) & boolean
🙁 Actual behavior
.\ts-versions\nightly\node_modules\.bin\tsc.cmd interfaceDoesNotDependOnBaseTypes_enriched_deep_mutated_batch6.ts
D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:123178
throw e;
^
RangeError: Maximum call stack size exceeded
at getTypeFromTypeReference (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:60415:36)
at getTypeFromTypeNodeWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63093:16)
at getTypeFromTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63055:41)
at getImpliedConstraint (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:60310:182)
at getConditionalFlowTypeOfType (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:60321:28)
at getTypeFromTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63055:12)
at getTypeFromRestTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63026:12)
at getTypeFromTypeNodeWorker (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63120:16)
at getTypeFromTypeNode (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:63055:41)
at map (D:\do\typeFuzz\ts-versions\nightly\node_modules\typescript\lib\_tsc.js:196:19)
🙂 Expected behavior
The compiler should not crash.
Additional information about the issue
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.