You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
#27370 breaks narrowing for constructor functions #27550
x doesn't narrow inside the if and x: any and x.val: any.
Actual behavior: x narrows to x: {} and gives an error on x.val.
I think the reason is that constructor functions are special-cased in resolveCallExpression -- they still only have call signatures, not construct signatures. The code in narrowTypeByInstanceof probably needs the same special-casing (or to have it in one place).
Activity