File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6576,6 +6576,10 @@ namespace ts {
65766576 return signature.resolvedReturnType;
65776577 }
65786578
6579+ function isResolvingReturnTypeOfSignature(signature: Signature) {
6580+ return !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, TypeSystemPropertyName.ResolvedReturnType) >= 0;
6581+ }
6582+
65796583 function getRestTypeOfSignature(signature: Signature): Type {
65806584 if (signature.hasRestParameter) {
65816585 const type = getTypeOfSymbol(lastOrUndefined(signature.parameters));
@@ -12949,7 +12953,7 @@ namespace ts {
1294912953 // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature
1295012954 // and that call signature is non-generic, return statements are contextually typed by the return type of the signature
1295112955 const signature = getContextualSignatureForFunctionLikeDeclaration(<FunctionExpression>functionDecl);
12952- if (signature) {
12956+ if (signature && !isResolvingReturnTypeOfSignature(signature) ) {
1295312957 return getReturnTypeOfSignature(signature);
1295412958 }
1295512959
You can’t perform that action at this time.
0 commit comments