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
Expected behavior: To be honest, I'm not entirely sure what I would expect the type M to be. Prior to 3.9, M resolves to unknown due to what I guess is the compiler giving up on instantiating the type which at least avoids a stack overflow. In this particular case, M can only ever be number regardless of how times the recursion is unfolded. Either way, I would not expect the compiler to crash.
Actual behavior: The compiler crashes due to a stack overflow when attempting to instantiate M.
The text was updated successfully, but these errors were encountered:
RyanCavanaugh
added
Bug
A bug in TypeScript
Crash
For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
labels
Jul 9, 2020
TypeScript Version: 4.0.0-dev.20200615
Search Terms: recursive type, maximum call stack size exceeded
Code
Expected behavior: To be honest, I'm not entirely sure what I would expect the type
M
to be. Prior to 3.9,M
resolves tounknown
due to what I guess is the compiler giving up on instantiating the type which at least avoids a stack overflow. In this particular case,M
can only ever benumber
regardless of how times the recursion is unfolded. Either way, I would not expect the compiler to crash.Actual behavior: The compiler crashes due to a stack overflow when attempting to instantiate
M
.Playground Link: https://www.typescriptlang.org/play/?ts=4.0.0-dev.20200615&ssl=1&ssc=1&pln=3&pc=25#code/C4TwDgpgBAcgPAFQDRQNJQgD2BAdgEwGcpDgAnAS1wHMA+KAXigSgB8oBvKAbQAUoqaALoAuWIhSp6AX26ohAbgBQS0JCgBZRuNwBXALYAjCGRQAiDWdoKgA
Related Issues: #38825
The text was updated successfully, but these errors were encountered: