A series of nested loops, undefined and in
checks results in incorrect implicit any
#45638
Labels
Needs Investigation
This issue needs a team member to investigate its status.
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
Bug Report
A series of nested loops, undefined and
in
checks results in incorrect implicit any.I don't know what is really causing this. It seems this might be a weird edge case where type inference fails?
🔎 Search Terms
noImplicitAny, inference
🕗 Version & Regression Information
This changed between versions 4.3.5 and 4.4.2
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
In version 4.4.2 the above code fails to compile with the 2 errors.
Any of the following changes cause it compile without errors:
|undefined
from theobjects
type.for (const _ of [])
loopif (id in map)
const id: string = obj.id!
🙂 Expected behavior
The code should compile without errors as it did in version 4.3.5.
The text was updated successfully, but these errors were encountered: