wrong type inferred in reduce
statement
#46707
Labels
Design Limitation
Constraints of the existing architecture prevent this from being fixed
reduce
statement
#46707
Bug Report
🕗 Version & Regression Information
Tried in 4.4.4 and Nightly version
⏯ Playground Link
https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBAYwgOwM7wJaoEIQgG2AENk4BeOACgDcj8BXYALjnuQGtkIB3ZASha0GwOFjgAjPIRLkAfHBgBPMMAgAzOEMbkyFAOSSCxZHoDcAKHNI08eqmABBACZEwMYFHJVUi5AgAiwCrITsB+GMCoLOhQGMgA5gDaALoANHBEPn6BwaHhkdEwsQkpcAA+ElLGfHJUoblhCBFRcDFxSckCcImG0sjpvcbJtQDe5nATiCjorPYOWQheWLhGJJSZvgFBYXlNkXzjk0cA-BkLOTuNzYdHEywb2dshV5EAdFDATvQIwJSUYB9qOl6jUyPIAcBqOUKvVLvlUK84ggGKFUJQQek1HR7AcblMbLMRBQ7I4FtDWpsLs94e9Pt9fv9AcCgqDwYDybDqXsEUiUZF0SzMdjgLijh8YPQoKREiT0iT5ptkuYAL6WKzTWxzFxuDwAJi8lHOT12zUKxQ66QeWwa8LN7VKFUGJFZdWNLxabRKnRYPSqJAGfuQwzBcDGR2sM3lZIoy0D6yNNu5B1uk1OVqpJsieKO9wTcO5tK+Pz+EKBcBBtVLHLdNN59FRArAfCF+BxlnDGsJXjzXOahfpJaZ5ZZlfZZRhNYLdYbGLgWNbIvJUc27cm4sl0tlhIVfiVqqAA
💻 Code
🙁 Actual behavior
TypeScript thinks that
syncDependencies.reduce()
returns astring
. If i removeuseAsync ||
in front of the reduce statement or place it after the reduce statement|| useAsync
it is detected as aboolean
🙂 Expected behavior
The reduce statement should return a value of type
boolean
because the value actually is aboolean
The text was updated successfully, but these errors were encountered: