mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Check for optional type parameters before issuing a "wrong number of
type arguments" error on a function call. Fixes #25683.
This commit is contained in:
1 parent
d9ed9177fe
commit
bd84179d82
6 files changed
+39
-5
No files matched your search
@@ -19083,7 +19083,7 @@ namespace ts {
|
||||
else if (candidateForTypeArgumentError) {
|
||||
checkTypeArguments(candidateForTypeArgumentError, (node as CallExpression | TaggedTemplateExpression).typeArguments!, /*reportErrors*/ true, fallbackError);
|
||||
}
|
||||
else if (typeArguments && every(signatures, sig => length(sig.typeParameters) !== typeArguments!.length)) {
|
||||
else if (typeArguments && every(signatures, sig => typeArguments!.length < getMinTypeArgumentCount(sig.typeParameters) || typeArguments!.length > length(sig.typeParameters))) {
|
||||
diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments));
|
||||
}
|
||||
else if (args) {
|
||||
|
||||
Reference in new issue
Block a user