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
ReadonlyArray with length should be narrowed in noUncheckedIndexedAccess #62719
I want to define a fixed length array and access if safely using noUncheckedIndexedAccess
A fixed-length array would be a tuple, and if you use a tuple it works.
I highly doubt your suggestion would get improved, because a viable workaround exists (use tuples), the intersection with the explicit length property has no effect on narrowing the ReadonlyArray<number> and the team expressed multiple times that they don't have any intention on improving the behavior of noUncheckedIndexedAccess.
Activity
MartinJohns commentedon Nov 5, 2025
Duplicate of #53678.
A fixed-length array would be a tuple, and if you use a tuple it works.
I highly doubt your suggestion would get improved, because a viable workaround exists (use tuples), the intersection with the explicit
lengthproperty has no effect on narrowing theReadonlyArray<number>and the team expressed multiple times that they don't have any intention on improving the behavior ofnoUncheckedIndexedAccess.hyunbinseo commentedon Nov 5, 2025
If so, I guess a Tuple utility would be the only workaround: