Fill missing type arguments during error reporting
Previously, only the success path did this; it was missing in the error reporting path in resolveCall. This resulted in crashes for unsupplied type arguments when the supplied type arguments were incorrect.
This commit is contained in:
parent
461e29bbd8
commit
3fef16008d
1 changed files with 3 additions and 1 deletions
|
@ -16203,8 +16203,10 @@ namespace ts {
|
|||
checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true);
|
||||
}
|
||||
else if (candidateForTypeArgumentError) {
|
||||
const isJavascript = isInJavaScriptFile(candidateForTypeArgumentError.declaration);
|
||||
const typeArguments = (<CallExpression>node).typeArguments;
|
||||
checkTypeArguments(candidateForTypeArgumentError, typeArguments, map(typeArguments, getTypeFromTypeNode), /*reportErrors*/ true, fallbackError);
|
||||
const typeArgumentTypes = fillMissingTypeArguments(map(typeArguments, getTypeFromTypeNode), candidateForTypeArgumentError.typeParameters, getMinTypeArgumentCount(candidateForTypeArgumentError.typeParameters), isJavascript);
|
||||
checkTypeArguments(candidateForTypeArgumentError, typeArguments, typeArgumentTypes, /*reportErrors*/ true, fallbackError);
|
||||
}
|
||||
else if (typeArguments && every(signatures, sig => length(sig.typeParameters) !== typeArguments.length)) {
|
||||
let min = Number.POSITIVE_INFINITY;
|
||||
|
|
Loading…
Reference in a new issue