From 1edb007acc899879488cecd850241c384dfb92a5 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 27 Oct 2015 17:00:28 -0700 Subject: [PATCH] Check for partial satisfiability when using the comparable relationship. --- src/compiler/checker.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cebbe9380e3..52a9d6db1e7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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(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, target, reportErrors)) { return result; }