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
4.5.0 regression - Maximum call stack size exceeded with recursive conditional typesΒ #46316
BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issue
type_PrependNextNum<AextendsArray<unknown>>=A['length']extends infer T
? [T, ...A]extends[...infer X]
? X
: never
: nevertype_Enumerate<AextendsArray<unknown>,Nextendsnumber>=NextendsA['length']
? A
: _Enumerate<_PrependNextNum<A>,N>&numberexporttypeEnumerate<Nextendsnumber>=numberextendsN
? number
: _Enumerate<[],N>extends(infer E)[]
? E
: neverdeclarefunctionfoo<Textendsunknown[]>(value: T): Enumerate<T['length']>{returnvalue.length}
Wesley Wigham (@weswigham) Another one caused by #41821, basically a duplicate of #46183. Issue again is an infinitely expanding recursive conditional type that should relate as Ternary.Maybe after five levels.
Well, first problem is that we're actually stacking out rather than reporting the "infinitely expanding type" error. That would seem to imply that we're not incrementing the depth counter enough somewhere. Though, yes, once that's fixed, it is likely a duplicate of the other.
BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issue
Activity
[-]`Maximum call stack size exceeded` with recursive conditional types[/-][+]5.5.0 regression - `Maximum call stack size exceeded` with recursive conditional types[/+][-]5.5.0 regression - `Maximum call stack size exceeded` with recursive conditional types[/-][+]4.5.0 regression - `Maximum call stack size exceeded` with recursive conditional types[/+]ahejlsberg commentedon Oct 12, 2021
Wesley Wigham (@weswigham) Another one caused by #41821, basically a duplicate of #46183. Issue again is an infinitely expanding recursive conditional type that should relate as
Ternary.Maybeafter five levels.weswigham commentedon Oct 12, 2021
Well, first problem is that we're actually stacking out rather than reporting the "infinitely expanding type" error. That would seem to imply that we're not incrementing the
depthcounter enough somewhere. Though, yes, once that's fixed, it is likely a duplicate of the other.