No error with === undefined
(or null) against a type that doesn't contain undefined (2367)
#37160
Labels
Duplicate
An existing issue was already created
TypeScript Version: Version 3.9.0-dev.20200229
Search Terms: 2367, no overlap,
Code
Expected behavior:
Expected error (with
strictNullChecks
on):This condition will always return 'false' since the types 'string' and 'undefined' have no overlap
Actual behavior:
No error
Playground Link: https://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=1&pc=40#code/JYMwBAFARALgpgZxlMBedYCuA7AJnEYbOXASjAG8wB6AKjADomxbqwBfIA
Related Issues:
#32627
typescript-eslint#1591
The text was updated successfully, but these errors were encountered: