Closed
Description
TypeScript Version: 3.6.3
Search Terms:
strictNullChecks
Code
const a = (x: number): number => {
if (x === null) {
console.log(1);
}
if (x === 'grhrt') {
console.log(1);
}
return x;
};
a(null);
Expected behavior:
With strictNullChecks
option I would expect an error in line 2 similar to the one in line 6. Something of the form "This condition will always return 'false'... "
Actual behavior:
No error in line 2
Playground Link: