-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Strange inference failure #20596
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
Comments
Essentially a duplicate of #1146 ? |
@jcalz There is a similarity but the reproductions look a bit different (loop vs |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
This is a design limitation of the current compiler implementation. The type of |
@mhegazy OK I'm still confused by the VS tooltip indicating |
TypeScript Version: 2.6.2
Code
Expected behavior:
next
is typed asNode | null
.Actual behavior:
next
is typed asany
, which raises an error undernoImplicitAny
.Comment: This is really strange because tooltips indicate that at this point
iter
is narrowed toNode
anditer.nextSibling
is of courseNode | null
.So it makes no sense that
let next = iter.nextSibling
isn't type as such.The text was updated successfully, but these errors were encountered: