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
There's a lot going on there that would need to be formalized. Specifically:
The expression of a property access becomes a literal type location.
An array literal becomes a literal type location if its parent is a literal type location.
indexOf would need to have a way of expressing that any value >= 0 implies that its type is related to its array's numeric index signature.
(1) and (2) are very easy to implement, but I think that (3) is too complex to express right now. While we have type predicate functions, we'd need a more powerful mechanism for expressing relationships between produced values and their arguments.
It would be great if TS could handle this: