You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: RangeError: Maximum call stack size exceeded in instantiateTypeWorker with recursive intersections and invalid type queries #63269
BugA bug in TypeScriptDomain: check: Type Circularitystackoverflows caused by circularities, or unexpected errors where no circularity appears to exist
// Repro from #31823exporttypePrepend<Elm,Textendsunknown[]>=Textendsunknown ?
((arg: Elm, ...rest: T)=>void)extends((...args: infer T2)=>void) ? T2 :
never :
never;exporttypeExactExtract<T,U>=(TextendsU ? UextendsT ? T : never : never)&string;typeConv<T,U=T>={0: [T];1: Prepend<T,Conv<ExactExtract<U,T>,{a: number}>>;}[UextendsT ? 0 : 1];
🙁 Actual behavior
node built/local/tsc.js -noEmit infiniteConstraints_mutated_batch12.ts
D:\github\TypeScript\built\local\_tsc.js:123721
throw e;
^
RangeError: Maximum call stack size exceeded
at instantiateType (D:\github\TypeScript\built\local\_tsc.js:63702:27)
at instantiateList (D:\github\TypeScript\built\local\_tsc.js:63329:24)
at instantiateTypes (D:\github\TypeScript\built\local\_tsc.js:63343:12)
at instantiateTypeWorker (D:\github\TypeScript\built\local\_tsc.js:63768:24)
at instantiateTypeWithAlias (D:\github\TypeScript\built\local\_tsc.js:63736:20)
at instantiateType (D:\github\TypeScript\built\local\_tsc.js:63703:29)
at instantiateList (D:\github\TypeScript\built\local\_tsc.js:63329:24)
at instantiateTypes (D:\github\TypeScript\built\local\_tsc.js:63343:12)
at instantiateTypeWorker (D:\github\TypeScript\built\local\_tsc.js:63787:72)
at instantiateTypeWithAlias (D:\github\TypeScript\built\local\_tsc.js:63736:20)
Node.js v22.19.0
🙂 Expected behavior
The fix implemented in #63136 is being bypassed by this specific construction. While the PR intended to yield an errorType when hitting the depth limit, this case triggers a RangeError before the compiler can recover or emit TS2589.
BugA bug in TypeScriptDomain: check: Type Circularitystackoverflows caused by circularities, or unexpected errors where no circularity appears to exist
Activity
RyanCavanaugh commentedon Mar 19, 2026
Confirmed repro in TS7