Merge pull request #4716 from Microsoft/optimizeFreshTypeRelation

Only obtain regular type of fresh object literal type if necessary
This commit is contained in:
Anders Hejlsberg
2015-09-10 16:14:29 -07:00
+4 -1
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;
@@ -5511,6 +5513,7 @@ namespace ts {
regularType.constructSignatures = (<ResolvedType>type).constructSignatures;
regularType.stringIndexType = (<ResolvedType>type).stringIndexType;
regularType.numberIndexType = (<ResolvedType>type).numberIndexType;
(<FreshObjectLiteralType>type).regularType = regularType;
}
return regularType;
}