Skip to content

Commit f14abfe

Browse files
committed
Add clarifying comment
1 parent 6fc5523 commit f14abfe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/compiler/checker.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4372,8 +4372,11 @@ module ts {
43724372
}
43734373

43744374
function reportNoCommonSupertypeError(types: Type[], errorLocation: Node, errorMessageChainHead: DiagnosticMessageChain): void {
4375+
// The downfallType/bestSupertypeDownfallType is the first type that caused a particular candidate
4376+
// to not be the common supertype. So if it weren't for this one downfallType (and possibly others),
4377+
// the type in question could have been the common supertype.
43754378
let bestSupertype: Type;
4376-
let bestSupertypeDownfallType: Type; // The type that caused bestSupertype not to be the common supertype
4379+
let bestSupertypeDownfallType: Type;
43774380
let bestSupertypeScore = 0;
43784381

43794382
for (let i = 0; i < types.length; i++) {
@@ -4575,9 +4578,9 @@ module ts {
45754578
inferences.push({ primary: undefined, secondary: undefined, isFixed: false });
45764579
}
45774580
return {
4578-
typeParameters: typeParameters,
4579-
inferUnionTypes: inferUnionTypes,
4580-
inferences: inferences,
4581+
typeParameters,
4582+
inferUnionTypes,
4583+
inferences,
45814584
inferredTypes: new Array(typeParameters.length),
45824585
};
45834586
}

0 commit comments

Comments
 (0)