Fixed an issue with top function type being callable with no arguments (#52387)

This commit is contained in:
Mateusz Burzyński
2023-03-01 18:35:36 +01:00
committed by GitHub
parent 6b75ce23ce
commit 02885b1a2e
5 changed files with 40 additions and 1 deletions

View File

@@ -34609,7 +34609,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function getNonArrayRestType(signature: Signature) {
const restType = getEffectiveRestType(signature);
return restType && !isArrayType(restType) && !isTypeAny(restType) && (getReducedType(restType).flags & TypeFlags.Never) === 0 ? restType : undefined;
return restType && !isArrayType(restType) && !isTypeAny(restType) ? restType : undefined;
}
function getTypeOfFirstParameterOfSignature(signature: Signature) {