From a65794c84d8ff8e00ab3121256ea65c9121922cf Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 4 Feb 2022 12:16:43 -0800 Subject: [PATCH] Add resetErrorInfo (though, oddly, shouldn't be necessary) --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e90c7824ece3d..8b7448c9103be 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18375,7 +18375,9 @@ namespace ts { } } else if (source.flags & TypeFlags.StructuredOrInstantiable || target.flags & TypeFlags.StructuredOrInstantiable) { - result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags); + if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) { + resetErrorInfo(saveErrorInfo); + } } if (!result && source.flags & (TypeFlags.Intersection | TypeFlags.TypeParameter)) { // The combined constraint of an intersection type is the intersection of the constraints of