Flow version: 0.96.0
Expected behavior
Null check assigned to variable should prevent flow error: property missing in null
Actual behavior
Currently null checking is recognised in a statement if (myVar !== null) { console.log(myVar.prop); } but fails when assigned to a property:
const isVarSet = myVar !== null;
if (isVarSet) { console.log(myVar.prop); }
- Link to Try-Flow or Github repo:
Flow try
I believe this issue is related too: #7202