@@ -16407,7 +16407,6 @@ namespace ts {
1640716407 let lastSkippedInfo: [Type, Type] | undefined;
1640816408 let incompatibleStack: [DiagnosticMessage, (string | number)?, (string | number)?, (string | number)?, (string | number)?][] = [];
1640916409 let inPropertyCheck = false;
16410- let recursiveVariances = false;
1641116410
1641216411 Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
1641316412
@@ -17256,7 +17255,7 @@ namespace ts {
1725617255 depth--;
1725717256 if (result) {
1725817257 if (result === Ternary.True || depth === 0) {
17259- if (result === Ternary.True || !recursiveVariances ) {
17258+ if (result === Ternary.True || result === Ternary.Maybe ) {
1726017259 // If result is definitely true, record all maybe keys as having succeeded
1726117260 for (let i = maybeStart; i < maybeCount; i++) {
1726217261 relation.set(maybeKeys[i], RelationComparisonResult.Succeeded | propagatingVarianceFlags);
@@ -17330,8 +17329,7 @@ namespace ts {
1733017329 !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
1733117330 const variances = getAliasVariances(source.aliasSymbol);
1733217331 if (variances === emptyArray) {
17333- recursiveVariances = true;
17334- return Ternary.Maybe;
17332+ return Ternary.Unknown;
1733517333 }
1733617334 const varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState);
1733717335 if (varianceResult !== undefined) {
@@ -17604,8 +17602,7 @@ namespace ts {
1760417602 // effectively means we measure variance only from type parameter occurrences that aren't nested in
1760517603 // recursive instantiations of the generic type.
1760617604 if (variances === emptyArray) {
17607- recursiveVariances = true;
17608- return Ternary.Maybe;
17605+ return Ternary.Unknown;
1760917606 }
1761017607 const varianceResult = relateVariances(getTypeArguments(<TypeReference>source), getTypeArguments(<TypeReference>target), variances, intersectionState);
1761117608 if (varianceResult !== undefined) {
0 commit comments