From 144a635bc54bf90515c55fccccac2bb62b949270 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 3 Jul 2015 11:20:44 -0700 Subject: [PATCH] Changing comment per CR feedback --- src/compiler/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index be823989b82..1e57cba0077 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4486,9 +4486,9 @@ namespace ts { } } else { - // A check of the form A | B = C & D can be satisfied either by having C be related to A | B, - // D be related to A | B, C & D be related to A, or C & D be related to B. Thus, we need to - // check both sides here. + // It is necessary to try "each" checks on both sides because there may be nested "some" checks + // on either side that need to be prioritized. For example, A | B = (A | B) & (C | D) or + // 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(source, target, reportErrors && !(target.flags & TypeFlags.Union))) {