From c4bf21b9cb26c8936bf51636ac14cabf2cc44fe6 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 6 Nov 2017 10:59:39 -0800 Subject: [PATCH] Improvements to checkUnusedIdentifiers (#19607) --- src/compiler/checker.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 532eee363d7..eb5442a7996 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20430,21 +20430,20 @@ namespace ts { case SyntaxKind.MethodSignature: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: - checkUnusedTypeParameters(node); - break; case SyntaxKind.TypeAliasDeclaration: - checkUnusedTypeParameters(node); + checkUnusedTypeParameters(node); break; + default: + Debug.fail("Node should not have been registered for unused identifiers check"); } } } } function checkUnusedLocalsAndParameters(node: Node): void { - if (node.parent.kind !== SyntaxKind.InterfaceDeclaration && noUnusedIdentifiers && !(node.flags & NodeFlags.Ambient)) { + if (noUnusedIdentifiers && !(node.flags & NodeFlags.Ambient)) { node.locals.forEach(local => { if (!local.isReferenced) { if (local.valueDeclaration && getRootDeclaration(local.valueDeclaration).kind === SyntaxKind.Parameter) {