Only normalize intersections that include {} (#50535)

* Only normalize intersections that include {}

* Accept new baselines
This commit is contained in:
Anders Hejlsberg
2022-08-31 14:36:03 -07:00
committed by GitHub
parent d293e723a2
commit 43f8ae6df4
2 changed files with 4 additions and 3 deletions

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);