Don't elaborate errors for relations from intersections to object types.

This commit is contained in:
Daniel Rosenwasser
2016-02-23 13:30:34 -08:00
parent 07412a285a
commit 035ccb9ad2

View File

@@ -5522,7 +5522,7 @@ namespace ts {
// A & B = (A & B) | (C & D).
if (source.flags & TypeFlags.Intersection) {
// If target is a union type the following check will report errors so we suppress them here
if (result = someTypeRelatedToType(<IntersectionType>source, target, reportErrors && !(target.flags & TypeFlags.Union))) {
if (result = someTypeRelatedToType(<IntersectionType>source, target, reportErrors && !(target.flags & (TypeFlags.Union | TypeFlags.ObjectType)))) {
return result;
}
}