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
I think there were some pre-existing inconsistencies in how optional chains might be narrowed down and how negation impacts them. I continue to investigate this issue and the other ones I found here: TS playground 1, TS playground 2
π Search Terms
narrowing undefined, incorrect type narrowing, incorrect if statement narrowing
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?#code/CYUwxgNghgTiAEkoGdnwILwN4CgCQAksugBQCUAXPAC4AWAlmoxgNw4C+OOoSciA9gDtk1eAAco1aiBiCqmAD7wAroNAAzeoJDA261WGr0h8KGLEQAngAVJ02eWz566+CQlSZggPwA6IqRk8AC8ofDqUBDIIEG4eHge9oJs8QD0qfAAet74eHDUyrIpnAl2XinpWTnsQA
π» Code
π Actual behavior
pattern
is narrowed down toA
, removing the undefinedπ Expected behavior
pattern
should only be narrowed toA | undefined
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: