Control Flow Analysis of Aliased Conditions and Discriminants doesn't work with === true
#49589
Labels
Duplicate
An existing issue was already created
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
This is behavior that exists in every version, expected to work since v4.4 when "Control Flow Analysis of Aliased Conditions and Discriminants" was introduced.
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Using
if (argIsString)
correctly narrowsarg
to type string. Usingif (argIsString === true)
however does not narrow thearg
parameter to string.🙂 Expected behavior
I expect
if (argIsString)
&if (argIsString === true)
to have the same behavior in terms of type narrowing in this case.The text was updated successfully, but these errors were encountered: