Feature Request: Infer types when using variable assignment with if-statements. #19421
Labels
Design Limitation
Constraints of the existing architecture prevent this from being fixed
Duplicate
An existing issue was already created
TypeScript Version: 2.6.0-dev.201xxxxx
Code
Expected behavior:
I would expect this code to compile without errors by simply refactoring some conditions into variables.
Actual behavior:
Unless the entire condition lives inside the if statement, there will be a type error.
The text was updated successfully, but these errors were encountered: