-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular reference misdetection #32950
Comments
🤔🤔🤔 Usually there's some sneaky dependency here, but I can't find one. We might be incorrectly thinking that the back edge of the Simplifiable a bit export function f(target: HTMLOListElement | DocumentFragment) {
if (target instanceof HTMLOListElement) {
for (const el of target.querySelectorAll('a')) {
if (el === target) {
}
}
}
} |
This bug is found in writing a polyfill of // expect
if (target instanceof HTMLOListElement) {
for (const el of target.querySelectorAll(':scope > li > a')) {
}
}
// polyfill
if (target instanceof HTMLOListElement) {
for (const el of target.querySelectorAll('a')) {
if (el.closest('ol') !== target) continue;
}
} |
I think what's happening here is that in order to determine the type of |
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? |
Not similar to the others. Should be filed as a separated issue. |
In TypeScript 3.7, circularity detection misfires on the declaration of `value` here. microsoft/TypeScript#32950 Declaring an explicit type avoids the problem.
In TypeScript 3.7, circularity detection misfires on the declaration of `value` here. microsoft/TypeScript#32950 Declaring an explicit type avoids the problem.
In TypeScript 3.7, circularity detection misfires on the declaration of `value` here. microsoft/TypeScript#32950 Declaring an explicit type avoids the problem. PR Close #33294
In TypeScript 3.7, circularity detection misfires on the declaration of `value` here. microsoft/TypeScript#32950 Declaring an explicit type avoids the problem. PR Close #33294
In TypeScript 3.7, circularity detection misfires on the declaration of `value` here. microsoft/TypeScript#32950 Declaring an explicit type avoids the problem. PR Close angular#33294
In TypeScript 3.7, circularity detection misfires on the declaration of `value` here. microsoft/TypeScript#32950 Declaring an explicit type avoids the problem. PR Close angular#33294
TypeScript Version: 3.4.0-dev.20190817
Search Terms:
Code
Expected behavior:
pass
Actual behavior:
Playground Link: http://www.typescriptlang.org/play/index.html#code/KYDwDg9gTgLgBAMwK4DsDGMCWEWIDwAqcoMwKAJgM5wASBAsgDIDyjmlMAogDbAC2ZeAB84AEQhokAlDABiUAIYBzaTAB8AChgKoS4DABccAgEojRAN4AoOHEwI4WnXviYUHBemAQHdJq3YuXlUTOGtbWwRoRzQcDmJuOB84bV19ADoARyRgKABPAGVgXgxoAEFubg0AcgVqk1DwiNt7R2L0tG4ISmAOGohuergAQgBeUZTnfVDYmTccgG4bCIBfZbXbKH0kKFxUlyWVoA
Related Issues:
The text was updated successfully, but these errors were encountered: