Skip to content

Commit 4beedcf

Browse files
committed
Update relation cache after we decide to elaborate an error
1 parent fbaba90 commit 4beedcf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5228,9 +5228,12 @@ namespace ts {
52285228
const id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + "," + apparentSource.id;
52295229
const related = relation[id];
52305230
if (related !== undefined) {
5231-
// If we computed this relation already and it was failed and reported, or if we're not being asked to elaborate
5232-
// errors, we can use the cached value. Otherwise, recompute the relation
5233-
if (!elaborateErrors || (related === RelationComparisonResult.FailedAndReported)) {
5231+
if (elaborateErrors && related === RelationComparisonResult.Failed) {
5232+
// We are elaborating errors and the cached result is an unreported failure. Record the result as a reported
5233+
// failure and continue computing the relation such that errors get reported.
5234+
relation[id] = RelationComparisonResult.FailedAndReported;
5235+
}
5236+
else {
52345237
return related === RelationComparisonResult.Succeeded ? Ternary.True : Ternary.False;
52355238
}
52365239
}

0 commit comments

Comments
 (0)