Cherry-pick PR #50535 into release-4.8 (#50549)

Component commits:
7bd2a6eeb7 Only normalize intersections that include {}

698c3ab770 Accept new baselines

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
This commit is contained in:
TypeScript Bot
2022-09-01 08:25:52 -07:00
committed by GitHub
parent 8b79b2ffb3
commit ac0cc8cefe
2 changed files with 4 additions and 3 deletions

View File

@@ -18465,7 +18465,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);