Skip to content

Commit 758cdf3

Browse files
committed
Only obtain regular type of fresh object literal type if necessary
1 parent 7f6608b commit 758cdf3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/compiler/checker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4640,7 +4640,9 @@ namespace ts {
46404640
// and intersection types are further deconstructed on the target side, we don't want to
46414641
// make the check again (as it might fail for a partial target type). Therefore we obtain
46424642
// the regular source type and proceed with that.
4643-
source = getRegularTypeOfObjectLiteral(source);
4643+
if (target.flags & TypeFlags.UnionOrIntersection) {
4644+
source = getRegularTypeOfObjectLiteral(source);
4645+
}
46444646
}
46454647

46464648
let saveErrorInfo = errorInfo;

0 commit comments

Comments
 (0)