@@ -12495,12 +12495,11 @@ namespace ts {
12495
12495
}
12496
12496
const id = getSymbolId(sourceSymbol) + "," + getSymbolId(targetSymbol);
12497
12497
const entry = enumRelation.get(id);
12498
- const relation = entry! & RelationComparisonResult.ResultMask;
12499
- if (entry !== undefined && !(relation === RelationComparisonResult.Failed && errorReporter)) {
12500
- return relation === RelationComparisonResult.Succeeded;
12498
+ if (entry !== undefined && !(!(entry & RelationComparisonResult.Reported) && entry & RelationComparisonResult.Failed && errorReporter)) {
12499
+ return !!(entry & RelationComparisonResult.Succeeded);
12501
12500
}
12502
12501
if (sourceSymbol.escapedName !== targetSymbol.escapedName || !(sourceSymbol.flags & SymbolFlags.RegularEnum) || !(targetSymbol.flags & SymbolFlags.RegularEnum)) {
12503
- enumRelation.set(id, RelationComparisonResult.FailedAndReported );
12502
+ enumRelation.set(id, RelationComparisonResult.Failed | RelationComparisonResult.Reported );
12504
12503
return false;
12505
12504
}
12506
12505
const targetEnumType = getTypeOfSymbol(targetSymbol);
@@ -12511,7 +12510,7 @@ namespace ts {
12511
12510
if (errorReporter) {
12512
12511
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property),
12513
12512
typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType));
12514
- enumRelation.set(id, RelationComparisonResult.FailedAndReported );
12513
+ enumRelation.set(id, RelationComparisonResult.Failed | RelationComparisonResult.Reported );
12515
12514
}
12516
12515
else {
12517
12516
enumRelation.set(id, RelationComparisonResult.Failed);
@@ -12576,7 +12575,7 @@ namespace ts {
12576
12575
if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Object) {
12577
12576
const related = relation.get(getRelationKey(source, target, relation));
12578
12577
if (related !== undefined) {
12579
- return (related & RelationComparisonResult.ResultMask) === RelationComparisonResult. Succeeded;
12578
+ return !! (related & RelationComparisonResult.Succeeded) ;
12580
12579
}
12581
12580
}
12582
12581
if (source.flags & TypeFlags.StructuredOrInstantiable || target.flags & TypeFlags.StructuredOrInstantiable) {
@@ -13261,9 +13260,8 @@ namespace ts {
13261
13260
}
13262
13261
const id = getRelationKey(source, target, relation);
13263
13262
const entry = relation.get(id);
13264
- const related = entry! & RelationComparisonResult.ResultMask;
13265
13263
if (entry !== undefined) {
13266
- if (reportErrors && related === RelationComparisonResult.Failed) {
13264
+ if (reportErrors && entry & RelationComparisonResult.Failed && !(entry & RelationComparisonResult.Reported) ) {
13267
13265
// We are elaborating errors and the cached result is an unreported failure. The result will be reported
13268
13266
// as a failure, and should be updated as a reported failure by the bottom of this function.
13269
13267
}
@@ -13278,7 +13276,7 @@ namespace ts {
13278
13276
instantiateType(source, reportUnreliableMarkers);
13279
13277
}
13280
13278
}
13281
- return related === RelationComparisonResult.Succeeded ? Ternary.True : Ternary.False;
13279
+ return entry & RelationComparisonResult.Succeeded ? Ternary.True : Ternary.False;
13282
13280
}
13283
13281
}
13284
13282
if (!maybeKeys) {
@@ -13334,7 +13332,7 @@ namespace ts {
13334
13332
else {
13335
13333
// A false result goes straight into global cache (when something is false under
13336
13334
// assumptions it will also be false without assumptions)
13337
- relation.set(id, (reportErrors ? RelationComparisonResult.FailedAndReported : RelationComparisonResult.Failed) | propagatingVarianceFlags);
13335
+ relation.set(id, (reportErrors ? RelationComparisonResult.Reported : 0) | RelationComparisonResult.Failed | propagatingVarianceFlags);
13338
13336
maybeCount = maybeStart;
13339
13337
}
13340
13338
return result;
0 commit comments