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
Not reporting error of deep object literal as expected #34619
This is fun, type checking for the contents of H[] seems to be completely disabled, you can stuff literally anything you want into that array and TypeScript won't make a peep:
The example is running into the depth limiter for nested instantiations of the same type. We stop once we've seen five or more instantiations, in this case of type Array<T>. Here's a very simple repro:
constaa: string[][][][][]=[[[[[42]]]]];// No error!
I'm going think about the best way to not trigger from nested literals (which are never recursive).
Activity
fatcerberus commentedon Oct 21, 2019
This is fun, type checking for the contents of
H[]seems to be completely disabled, you can stuff literally anything you want into that array and TypeScript won't make a peep:RyanCavanaugh commentedon Oct 22, 2019
Anders Hejlsberg (@ahejlsberg) I'm not aware of any limiters that should apply in this scenario?
ahejlsberg commentedon Oct 25, 2019
The example is running into the depth limiter for nested instantiations of the same type. We stop once we've seen five or more instantiations, in this case of type
Array<T>. Here's a very simple repro:I'm going think about the best way to not trigger from nested literals (which are never recursive).