that !== null && typeof that === "object"
still claims that that
can be null
#40363
Labels
Duplicate
An existing issue was already created
TypeScript Version: 4.0.2
Search Terms:
typeof, object, narrow, if, null
Code
Expected behavior:
Compile.
Actual behavior:
Fails with error
Playground Link:
https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABAIwE5wNYFMwAooAWAhlAFyLgZhwDuYAlOXMgFZbSIDeAUIojMET5iURAEIAvBMRgQAGzmIAZEsRQAngAcscQYRKIp0gETM20Y-S68+iVFighUSfVADcNgL437j5108Pb25QSFgERBo4VAwAZ2ESckpqOkZEM3ZRHj4BIQ1tXTURQylEU1ZM42VVV3FS2QUrbNtfJxcRDz5vPlb-TkDuTyA
The text was updated successfully, but these errors were encountered: