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
Righto, so this is a bit interesting. Since the index distributes to number[string] | number[string[]] and noImplicitAny is off, number[string] silently becomes any and then we don't bother to check number[string[]]. I can fix it so we still do the validity check even if we won't use the type; just thought it was interesting~
TypeScript Version: master at bd40583
Search Terms: array index union error
Code
Expected behavior: Error - Type
string[]
cannot be used as an index typeActual behavior: No error
Playground Link: Link
Related Issues: Regressed during fix of #26409 (edit: #26281 ?)
The text was updated successfully, but these errors were encountered: