Check for partial satisfiability when using the comparable relationship.

This commit is contained in:
Daniel Rosenwasser
2015-10-27 17:00:28 -07:00
parent 43f158d418
commit 1edb007acc
+6
View File
@@ -4877,11 +4877,17 @@ namespace ts {
// Note that the "each" checks must precede the "some" checks to produce the correct results
if (source.flags & TypeFlags.Union) {
if (relation === comparableRelation && (result = someTypeRelatedToType(source as UnionType, target, reportErrors))) {
return result;
}
if (result = eachTypeRelatedToType(<UnionType>source, target, reportErrors)) {
return result;
}
}
else if (target.flags & TypeFlags.Intersection) {
if (relation === comparableRelation && (result = typeRelatedToSomeType(source, target as IntersectionType, reportErrors))) {
return result;
}
if (result = typeRelatedToEachType(source, <IntersectionType>target, reportErrors)) {
return result;
}