'null' and 'undefined' are bottom types in non-strictNullChecks mode

This commit is contained in:
Anders Hejlsberg committed 2018-05-26 12:09:18 -07:00
1 parent 5a0910a675
commit b20925ad40
1 file changed
+3
+3
View File
@@ -8592,6 +8592,9 @@ namespace ts {
if (includes & TypeFlags.Any) {
return includes & TypeFlags.Wildcard ? wildcardType : anyType;
}
if (!strictNullChecks && includes & TypeFlags.Nullable) {
return includes & TypeFlags.Undefined ? undefinedType : nullType;
}
if (includes & TypeFlags.String && includes & TypeFlags.StringLiteral ||
includes & TypeFlags.Number && includes & TypeFlags.NumberLiteral ||
includes & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol) {