Only obtain regular type of fresh object literal type if necessary

This commit is contained in:
Anders Hejlsberg 2015-08-30 15:07:04 -07:00
parent 7f6608b2b9
commit 758cdf3378

View File

@ -4640,7 +4640,9 @@ namespace ts {
// and intersection types are further deconstructed on the target side, we don't want to
// make the check again (as it might fail for a partial target type). Therefore we obtain
// the regular source type and proceed with that.
source = getRegularTypeOfObjectLiteral(source);
if (target.flags & TypeFlags.UnionOrIntersection) {
source = getRegularTypeOfObjectLiteral(source);
}
}
let saveErrorInfo = errorInfo;