noUncheckedIndexAccess
behavior with for...in loops with a constant
#45169
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
Bug Report
Using a
for...in
loop with a constant key variable errors withnoUncheckedIndexAccess
.🔎 Search Terms
for...in
noUncheckedIndexAccess
for(const in)
🕗 Version & Regression Information
Seen in v4.1.5 (oldest playground with noUncheckedIndexAccess) and next (v4.4.0-dev.20210723 at time of writing)
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Error:
🙂 Expected behavior
No error, key is in object by the
for...in
loop and clearly isn't modified as variable is constThe text was updated successfully, but these errors were encountered: