question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Circular reference misdetection

See original GitHub issue

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.

Playground Link: http://www.typescriptlang.org/play/index.html#code/KYDwDg9gTgLgBAMwK4DsDGMCWEWIDwAqcoMwKAJgM5wASBAsgDIDyjmlMAogDbAC2ZeAB84AEQhokAlDABiUAIYBzaTAB8AChgKoS4DABccAgEojRAN4AoOHEwI4WnXviYUHBemAQHdJq3YuXlUTOGtbWwRoRzQcDmJuOB84bV19ADoARyRgKABPAGVgXgxoAEFubg0AcgVqk1DwiNt7R2L0tG4ISmAOGohuergAQgBeUZTnfVDYmTccgG4bCIBfZbXbKH0kKFxUlyWVoA

Related Issues:

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
falsandtrucommented, Sep 5, 2019

Not similar to the others. Should be filed as a separated issue.

0reactions
thorn0commented, Sep 5, 2019

Another instance (playground; reproduces in TS 3.6.2 too):

declare function f(): 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove or allow a circular reference - Microsoft Support
Find and remove a circular reference. You can also learn about the circular reference warning message and iterative calculation in Excel.
Read more >
How to fix a circular reference in Excel - Spreadsheet Class
The circular reference error in Excel, is a very common error that can occur when using almost any formula. When you see the...
Read more >
Relative Reachable Domain for Spacecraft with ... - AIAA ARC
The relative reachable domain formulations are analytically expressed for circular reference orbits. It is shown that the relative reachable domain is aΒ ...
Read more >
Three-dimensional relative reachable domain with initial state ...
In this study, the reference orbit is assumed to be circular. ... Because satellite relative motion along circular reference orbits are more commonly...
Read more >
Relative Reachable Domain for Spacecraft with Initial State ...
formulations are analytically expressed for circular reference orbits. ... misdetection situations when the overlapping between three-sigma.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found