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
With the compiler currently in master we don't hang on the original example (probably because of #26558), but it still takes 7.5s to type check and allocates over 700,000 types.
The core issue here is the pattern of using indexed access types to write self-referencing conditional types. It is a Turing Complete device (#14833) and along with that comes the halting problem. It is effectively impossible for us to know if evaluation of such types will ever terminate. For this reason I strongly discourage use of the pattern.
Activity
ahejlsberg commentedon Oct 10, 2018
With the compiler currently in
masterwe don't hang on the original example (probably because of #26558), but it still takes 7.5s to type check and allocates over 700,000 types.The core issue here is the pattern of using indexed access types to write self-referencing conditional types. It is a Turing Complete device (#14833) and along with that comes the halting problem. It is effectively impossible for us to know if evaluation of such types will ever terminate. For this reason I strongly discourage use of the pattern.