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
const el: any
'el' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
🤔🤔🤔 Usually there's some sneaky dependency here, but I can't find one. We might be incorrectly thinking that the back edge of the for loop somehow influences el, but it doesn't?
I think what's happening here is that in order to determine the type of el we have to determine the type of target.querySelectorAll('a'), which requires us determine the control flow type of target, which could be narrowed by the expression el.closest('ol') !== target, which requires us to determine the type of el, which triggers a circularity.
Another instance (playground; reproduces in TS 3.6.2 too):
declarefunctionf(): number|undefined;const[a,b=a]=[10,f()];// 'a' implicitly has type 'any' because it does not have a type annotation and // is referenced directly or indirectly in its own initializer.
Or is this #33191? Or are these two issues the same?
Activity
RyanCavanaugh commentedon Aug 19, 2019
🤔🤔🤔 Usually there's some sneaky dependency here, but I can't find one. We might be incorrectly thinking that the back edge of the
forloop somehow influencesel, but it doesn't?Simplifiable a bit
falsandtru commentedon Aug 19, 2019
This bug is found in writing a polyfill of
:scopekeyword for Edge browser.ahejlsberg commentedon Aug 19, 2019
I think what's happening here is that in order to determine the type of
elwe have to determine the type oftarget.querySelectorAll('a'), which requires us determine the control flow type oftarget, which could be narrowed by the expressionel.closest('ol') !== target, which requires us to determine the type ofel, which triggers a circularity.thorn0 commentedon Sep 5, 2019
Another instance (playground; reproduces in TS 3.6.2 too):
Or is this #33191? Or are these two issues the same?
falsandtru commentedon Sep 5, 2019
Not similar to the others. Should be filed as a separated issue.
fix(zone.js): work around TS3.7 issue
fix(zone.js): work around TS3.7 issue
fix(zone.js): work around TS3.7 issue (#33294)
fix(zone.js): work around TS3.7 issue (#33294)
danvk commentedon Feb 28, 2024
This was fixed in d26afd7 which was part of #32695, which was released in TS 3.7 back in 2019.