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
Iterator result of Iterable or AsyncIterable inferred to any #33932
In addition to also wanting the fix suggested above (plumbing TReturn and TNext from AsyncIterableIterator to IteratorResult), I wonder if any is the best type? When I see an any I don't suspect I need to narrow, I suspect I've done something wrong. undefined could be a better default, though I haven't considered this at length.
Activity
ikokostya commentedon Oct 10, 2019
With explicit check
doneproperty ofIteartorResult:bterlson commentedon Feb 8, 2020
In addition to also wanting the fix suggested above (plumbing TReturn and TNext from AsyncIterableIterator to IteratorResult), I wonder if
anyis the best type? When I see ananyI don't suspect I need to narrow, I suspect I've done something wrong.undefinedcould be a better default, though I haven't considered this at length.rbuckton commentedon Dec 16, 2020
This is a duplicate of 33353. Also, your expected behavior is incorrect. Without checking
done, you cannot guarantee thatvalueis a number:While the correct result should be
number | undefined, but may be a significant breaking change.ikokostya commentedon Dec 16, 2020
Duplicate of #33353