Skip to content

Commit 70feb7b

Browse files
Avoid duplicate code when checking for tagged templates.
1 parent 7f96fec commit 70feb7b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17749,15 +17749,11 @@ namespace ts {
1774917749

1775017750
let typeArguments: NodeArray<TypeNode>;
1775117751

17752-
if (isTaggedTemplate) {
17753-
typeArguments = (node as TaggedTemplateExpression).typeArguments;
17754-
forEach(typeArguments, checkSourceElement);
17755-
}
17756-
else if (!isDecorator && !isJsxOpeningOrSelfClosingElement) {
17752+
if (!isDecorator && !isJsxOpeningOrSelfClosingElement) {
1775717753
typeArguments = (<CallExpression>node).typeArguments;
1775817754

1775917755
// We already perform checking on the type arguments on the class declaration itself.
17760-
if ((<CallExpression>node).expression.kind !== SyntaxKind.SuperKeyword) {
17756+
if (isTaggedTemplate || (<CallExpression>node).expression.kind !== SyntaxKind.SuperKeyword) {
1776117757
forEach(typeArguments, checkSourceElement);
1776217758
}
1776317759
}

0 commit comments

Comments
 (0)