Skip to content

Commit 2bf3cf9

Browse files
committed
Remove RelationComparisonResult.Reported entirely
1 parent 8a0b6c0 commit 2bf3cf9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20198,21 +20198,19 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2019820198
}
2019920199
const id = getSymbolId(sourceSymbol) + "," + getSymbolId(targetSymbol);
2020020200
const entry = enumRelation.get(id);
20201-
if (entry !== undefined && !(!(entry & RelationComparisonResult.Reported) && entry & RelationComparisonResult.Failed && errorReporter)) {
20201+
if (entry !== undefined && !(entry & RelationComparisonResult.Failed && errorReporter)) {
2020220202
return !!(entry & RelationComparisonResult.Succeeded);
2020320203
}
2020420204
const targetEnumType = getTypeOfSymbol(targetSymbol);
2020520205
for (const property of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
2020620206
if (property.flags & SymbolFlags.EnumMember) {
2020720207
const targetProperty = getPropertyOfType(targetEnumType, property.escapedName);
2020820208
if (!targetProperty || !(targetProperty.flags & SymbolFlags.EnumMember)) {
20209+
enumRelation.set(id, RelationComparisonResult.Failed);
20210+
2020920211
if (errorReporter) {
2021020212
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property),
2021120213
typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType));
20212-
enumRelation.set(id, RelationComparisonResult.Failed | RelationComparisonResult.Reported);
20213-
}
20214-
else {
20215-
enumRelation.set(id, RelationComparisonResult.Failed);
2021620214
}
2021720215
return false;
2021820216
}
@@ -21331,7 +21329,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2133121329
else {
2133221330
// A false result goes straight into global cache (when something is false under
2133321331
// assumptions it will also be false without assumptions)
21334-
relation.set(id, (reportErrors ? RelationComparisonResult.Reported : 0) | RelationComparisonResult.Failed | propagatingVarianceFlags);
21332+
relation.set(id, RelationComparisonResult.Failed | propagatingVarianceFlags);
2133521333
resetMaybeStack(/*markAllAsSucceeded*/ false);
2133621334
}
2133721335
return result;

src/compiler/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,6 @@ export const enum JsxFlags {
904904
export const enum RelationComparisonResult {
905905
Succeeded = 1 << 0, // Should be truthy
906906
Failed = 1 << 1,
907-
Reported = 1 << 2,
908907

909908
ReportsUnmeasurable = 1 << 3,
910909
ReportsUnreliable = 1 << 4,

0 commit comments

Comments
 (0)