mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Perform checking and resolution of tagged template type arguments.
This commit is contained in:
@@ -17749,7 +17749,11 @@ namespace ts {
|
||||
|
||||
let typeArguments: NodeArray<TypeNode>;
|
||||
|
||||
if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) {
|
||||
if (isTaggedTemplate) {
|
||||
typeArguments = (node as TaggedTemplateExpression).typeArguments;
|
||||
forEach(typeArguments, checkSourceElement);
|
||||
}
|
||||
else if (!isDecorator && !isJsxOpeningOrSelfClosingElement) {
|
||||
typeArguments = (<CallExpression>node).typeArguments;
|
||||
|
||||
// We already perform checking on the type arguments on the class declaration itself.
|
||||
@@ -17866,7 +17870,7 @@ namespace ts {
|
||||
checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true);
|
||||
}
|
||||
else if (candidateForTypeArgumentError) {
|
||||
checkTypeArguments(candidateForTypeArgumentError, (node as CallExpression).typeArguments, /*reportErrors*/ true, fallbackError);
|
||||
checkTypeArguments(candidateForTypeArgumentError, (node as CallExpression | TaggedTemplateExpression).typeArguments, /*reportErrors*/ true, fallbackError);
|
||||
}
|
||||
else if (typeArguments && every(signatures, sig => length(sig.typeParameters) !== typeArguments.length)) {
|
||||
diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments));
|
||||
@@ -18660,6 +18664,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function checkTaggedTemplateExpression(node: TaggedTemplateExpression): Type {
|
||||
checkGrammarTypeArguments(node, node.typeArguments);
|
||||
if (languageVersion < ScriptTarget.ES2015) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.MakeTemplateObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user