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
Circular type false positive with async/await #51115
asyncfunctionget_things(_: number|undefined){return[0];}asyncfunctionfoobar(){// The error goes away without the `| undefined`letbefore: number|undefined=undefined;// The error goes away without the loopfor(leti=0;i<2;i++){// The error goes away without the async/awaitconstresults=awaitget_things(before);// ^ 'results' implicitly has type 'any' because it does not have a type annotation// and is referenced directly or indirectly in its own initializer.before=results[0];}}
🙁 Actual behavior
This results in an error
'results' implicitly has type 'any' because it does not have a type annotation
and is referenced directly or indirectly in its own initializer.
Activity
jeremy-rifkin commentedon Oct 9, 2022
This bug is similar to #48708 but is present as far back as the playground goes (3.3.3). It stands apart largely because of the async/await.
whzx5byb commentedon Oct 9, 2022
Duplicate of #43047
Andarist commentedon Oct 9, 2022
FYI: I have a fix locally for this one - just need to clean the code up and prepare a PR some time later