Skip to content

Commit faaf219

Browse files
authored
Merge pull request #10726 from Microsoft/port10703
Port #10703 to release-2.0
2 parents 66d456d + 9adc26c commit faaf219

File tree

4 files changed

+5091
-3
lines changed

4 files changed

+5091
-3
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ namespace ts {
143143

144144
const anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
145145
const unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
146+
const resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
146147

147148
const enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true);
148149

@@ -12205,10 +12206,10 @@ namespace ts {
1220512206
// or that a different candidatesOutArray was passed in. Therefore, we need to redo the work
1220612207
// to correctly fill the candidatesOutArray.
1220712208
const cached = links.resolvedSignature;
12208-
if (cached && cached !== anySignature && !candidatesOutArray) {
12209+
if (cached && cached !== resolvingSignature && !candidatesOutArray) {
1220912210
return cached;
1221012211
}
12211-
links.resolvedSignature = anySignature;
12212+
links.resolvedSignature = resolvingSignature;
1221212213
const result = resolveSignature(node, candidatesOutArray);
1221312214
// If signature resolution originated in control flow type analysis (for example to compute the
1221412215
// assigned type in a flow assignment) we don't cache the result as it may be based on temporary
@@ -12220,7 +12221,7 @@ namespace ts {
1222012221
function getResolvedOrAnySignature(node: CallLikeExpression) {
1222112222
// If we're already in the process of resolving the given signature, don't resolve again as
1222212223
// that could cause infinite recursion. Instead, return anySignature.
12223-
return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node);
12224+
return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node);
1222412225
}
1222512226

1222612227
function getInferredClassType(symbol: Symbol) {

0 commit comments

Comments
 (0)