Closed
Description
TypeScript Version: 2.6.2
Code
let x: { nodes: DocumentFragment, _start: Comment };
let iter: Node | null, nodes: DocumentFragment;
({ nodes, _start: iter } = x!);
while (iter) {
let next = iter.nextSibling;
nodes.appendChild(iter);
iter = next;
}
Expected behavior: next
is typed as Node | null
.
Actual behavior: next
is typed as any
, which raises an error under noImplicitAny
.
Comment: This is really strange because tooltips indicate that at this point iter
is narrowed to Node
and iter.nextSibling
is of course Node | null
.
So it makes no sense that let next = iter.nextSibling
isn't type as such.