Only normalize intersections that include {}

This commit is contained in:
Anders Hejlsberg
2022-08-30 07:41:04 -07:00
parent c89f355a41
commit 7bd2a6eeb7
+1 -1
View File
@@ -18493,7 +18493,7 @@ namespace ts {
if (reduced !== type) {
return reduced;
}
if (type.flags & TypeFlags.Intersection) {
if (type.flags & TypeFlags.Intersection && some((type as IntersectionType).types, isEmptyAnonymousObjectType)) {
const normalizedTypes = sameMap(type.types, t => getNormalizedType(t, writing));
if (normalizedTypes !== type.types) {
return getIntersectionType(normalizedTypes);