@@ -16407,7 +16407,6 @@ namespace ts {
16407
16407
let lastSkippedInfo: [Type, Type] | undefined;
16408
16408
let incompatibleStack: [DiagnosticMessage, (string | number)?, (string | number)?, (string | number)?, (string | number)?][] = [];
16409
16409
let inPropertyCheck = false;
16410
- let recursiveVariances = false;
16411
16410
16412
16411
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
16413
16412
@@ -17256,7 +17255,7 @@ namespace ts {
17256
17255
depth--;
17257
17256
if (result) {
17258
17257
if (result === Ternary.True || depth === 0) {
17259
- if (result === Ternary.True || !recursiveVariances ) {
17258
+ if (result === Ternary.True || result === Ternary.Maybe ) {
17260
17259
// If result is definitely true, record all maybe keys as having succeeded
17261
17260
for (let i = maybeStart; i < maybeCount; i++) {
17262
17261
relation.set(maybeKeys[i], RelationComparisonResult.Succeeded | propagatingVarianceFlags);
@@ -17330,8 +17329,7 @@ namespace ts {
17330
17329
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
17331
17330
const variances = getAliasVariances(source.aliasSymbol);
17332
17331
if (variances === emptyArray) {
17333
- recursiveVariances = true;
17334
- return Ternary.Maybe;
17332
+ return Ternary.Unknown;
17335
17333
}
17336
17334
const varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState);
17337
17335
if (varianceResult !== undefined) {
@@ -17604,8 +17602,7 @@ namespace ts {
17604
17602
// effectively means we measure variance only from type parameter occurrences that aren't nested in
17605
17603
// recursive instantiations of the generic type.
17606
17604
if (variances === emptyArray) {
17607
- recursiveVariances = true;
17608
- return Ternary.Maybe;
17605
+ return Ternary.Unknown;
17609
17606
}
17610
17607
const varianceResult = relateVariances(getTypeArguments(<TypeReference>source), getTypeArguments(<TypeReference>target), variances, intersectionState);
17611
17608
if (varianceResult !== undefined) {
0 commit comments