Mark IIFE signature with anySignature during contextual typing

Avoids recursion -- during batch compilation, `checkCallExpression` already
sets the signature to `anySignature` as a sentinel value, the services
layer calls directly into `checkParameter`, skipping `checkCallExpression`
entirely. So `getContextuallyTypedParameterType` also needs to set this
sentinel value.
This commit is contained in:
Nathan Shively-Sanders
2016-05-19 12:33:37 -07:00
parent c9ab20c13b
commit 8e668441b3
2 changed files with 44 additions and 1 deletions

View File

@@ -8606,7 +8606,12 @@ namespace ts {
}
return createArrayType(getUnionType(restTypes));
}
return checkExpression(iife.arguments[indexOfParameter]);
const links = getNodeLinks(iife);
const cached = links.resolvedSignature;
links.resolvedSignature = anySignature;
const type = checkExpression(iife.arguments[indexOfParameter]);
links.resolvedSignature = cached;
return type;
}
}
const contextualSignature = getContextualSignature(func);