Closed
Description
TypeScript Version: 3.4.0-dev.20190817
Search Terms:
Code
export function f<T extends HTMLOListElement | DocumentFragment>(target: T): T {
if (target instanceof HTMLOListElement) {
for (const el of target.querySelectorAll('a')) {
if (el.closest('ol') !== target) continue;
}
}
return target;
}
Expected behavior:
pass
Actual behavior:
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.
Related Issues: