mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Fix checker handling for empty type argument lists (#34790)
This commit is contained in:
@@ -23435,7 +23435,7 @@ namespace ts {
|
||||
// the declared number of type parameters, the call has an incorrect arity.
|
||||
const numTypeParameters = length(signature.typeParameters);
|
||||
const minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters);
|
||||
return !typeArguments ||
|
||||
return !some(typeArguments) ||
|
||||
(typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters);
|
||||
}
|
||||
|
||||
@@ -24195,7 +24195,7 @@ namespace ts {
|
||||
|
||||
if (isSingleNonGenericCandidate) {
|
||||
const candidate = candidates[0];
|
||||
if (typeArguments || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) {
|
||||
if (some(typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma)) {
|
||||
return undefined;
|
||||
}
|
||||
if (getSignatureApplicabilityError(node, args, candidate, relation, CheckMode.Normal, /*reportErrors*/ false, /*containingMessageChain*/ undefined)) {
|
||||
@@ -24216,7 +24216,7 @@ namespace ts {
|
||||
|
||||
if (candidate.typeParameters) {
|
||||
let typeArgumentTypes: Type[] | undefined;
|
||||
if (typeArguments) {
|
||||
if (some(typeArguments)) {
|
||||
typeArgumentTypes = checkTypeArguments(candidate, typeArguments, /*reportErrors*/ false);
|
||||
if (!typeArgumentTypes) {
|
||||
candidateForTypeArgumentError = candidate;
|
||||
|
||||
Reference in New Issue
Block a user