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
type incorrectly narrowed because assignment of a different value in function not seenΒ #62672
There is an error on the bar property lookup. foo has been narrowed to null because TypeScript thinks we never assign it to something other than null, and in the else branch it is narrowed to never because we've checked it is not null so there are no more types it could possibly be.
π Expected behavior
There should be no error. If TypeScript cannot prove that foo is never assigned a non-null value then it should not assume that.
Activity
jcalz commentedon Oct 25, 2025
Yet another duplicate of #9998
190n commentedon Oct 25, 2025
Ah sorry I didn't find that one, thanks.