Consistently avoid pulling on the source return type when the target return type is any (#47306)

This commit is contained in:
Wesley Wigham
2022-03-15 18:16:05 -07:00
committed by GitHub
parent 8e5a84a696
commit 92bc2ddc3c
5 changed files with 141 additions and 1 deletions

View File

@@ -17903,7 +17903,7 @@ namespace ts {
const targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType
: target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(target.declaration.symbol))
: getReturnTypeOfSignature(target);
if (targetReturnType === voidType) {
if (targetReturnType === voidType || targetReturnType === anyType) {
return result;
}
const sourceReturnType = isResolvingReturnTypeOfSignature(source) ? anyType