Broken Type guard narrowing when strictnullcheck
is false
#61546
Labels
Not a Defect
This behavior is one of several equally-correct options
strictnullcheck
is false
#61546
π Search Terms
π Version & Regression Information
Not a regression
β― Playground Link
https://www.typescriptlang.org/play/?strict=false&strictFunctionTypes=false&strictPropertyInitialization=false&strictBindCallApply=false#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgMQggB4AVAPjgG8AoOOKYTAEwiQBsBPOAN03YCuwAFxxSAbjpwAFpgDOANX5CAFAEpRMaQjmJdhEgFEQ2Qc2BkANHAFJz6ZMGblykgL40a505kZxsbHLw6ESiBsRBUMgA5nAAPjZ2wA5ITq40COhwKiEQAHSyisrA6mrUUrlSAPRVAHoA-DRucMDscni09JX0NQ1NnkA
π» Code
π Actual behavior
In the
else
block,foo
isnever
π Expected behavior
foo
should beFoo<string|undefined>
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: