Skip to content

Commit 3652682

Browse files
committed
{} & null and {} & undefined should be never in non-strictNullChecks mode
1 parent f071d30 commit 3652682

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15166,7 +15166,7 @@ namespace ts {
1516615166
return includes & TypeFlags.IncludesWildcard ? wildcardType : anyType;
1516715167
}
1516815168
if (!strictNullChecks && includes & TypeFlags.Nullable) {
15169-
return includes & TypeFlags.Undefined ? undefinedType : nullType;
15169+
return includes & TypeFlags.IncludesEmptyObject ? neverType : includes & TypeFlags.Undefined ? undefinedType : nullType;
1517015170
}
1517115171
if (includes & TypeFlags.String && includes & (TypeFlags.StringLiteral | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) ||
1517215172
includes & TypeFlags.Number && includes & TypeFlags.NumberLiteral ||

0 commit comments

Comments
 (0)