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
Adding boolean type assertion changes type narrowing Β #60190
changed the title [-]Adding boolean type assertion changes type narrowing for undefined[/-][+]Adding boolean type assertion changes type narrowing [/+]on Oct 10, 2024
Ryan Cavanaugh (@RyanCavanaugh) Thanks for the quick response! Is there a specific reason why this choice was made? I don't see that listed. Regardless we can close the ticket.
IIRC it's possible to get into a type resolution circularity with this inference in a way that wouldn't really be solvable, so you need some "out" in cases where you're not using it for narrowing purposes
Activity
[-]Adding boolean type assertion changes type narrowing for undefined[/-][+]Adding boolean type assertion changes type narrowing [/+]RyanCavanaugh commentedon Oct 10, 2024
This was an intentional boundary in #44730
jauwesome commentedon Oct 10, 2024
Ryan Cavanaugh (@RyanCavanaugh) Thanks for the quick response! Is there a specific reason why this choice was made? I don't see that listed. Regardless we can close the ticket.
RyanCavanaugh commentedon Oct 10, 2024
IIRC it's possible to get into a type resolution circularity with this inference in a way that wouldn't really be solvable, so you need some "out" in cases where you're not using it for narrowing purposes
jauwesome commentedon Oct 11, 2024
Good to know! That makes sense. Thanks again for your help!