Skip to content

Commit 9260a39

Browse files
author
Andy
authored
Remove duplicate switch cases (#16721)
1 parent 42e08f5 commit 9260a39

File tree

4 files changed

+0
-9
lines changed

4 files changed

+0
-9
lines changed

src/compiler/program.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,6 @@ namespace ts {
11371137
case SyntaxKind.FunctionExpression:
11381138
case SyntaxKind.FunctionDeclaration:
11391139
case SyntaxKind.ArrowFunction:
1140-
case SyntaxKind.FunctionDeclaration:
11411140
case SyntaxKind.VariableDeclaration:
11421141
// type annotation
11431142
if ((<FunctionLikeDeclaration | VariableDeclaration | ParameterDeclaration | PropertyDeclaration>parent).type === node) {
@@ -1202,7 +1201,6 @@ namespace ts {
12021201
case SyntaxKind.FunctionExpression:
12031202
case SyntaxKind.FunctionDeclaration:
12041203
case SyntaxKind.ArrowFunction:
1205-
case SyntaxKind.FunctionDeclaration:
12061204
// Check type parameters
12071205
if (nodes === (<ClassDeclaration | FunctionLikeDeclaration>parent).typeParameters) {
12081206
diagnostics.push(createDiagnosticForNodeArray(nodes, Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file));

src/compiler/utilities.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,6 @@ namespace ts {
11551155

11561156
export function isPartOfExpression(node: Node): boolean {
11571157
switch (node.kind) {
1158-
case SyntaxKind.ThisKeyword:
11591158
case SyntaxKind.SuperKeyword:
11601159
case SyntaxKind.NullKeyword:
11611160
case SyntaxKind.TrueKeyword:
@@ -1224,7 +1223,6 @@ namespace ts {
12241223
case SyntaxKind.SwitchStatement:
12251224
case SyntaxKind.CaseClause:
12261225
case SyntaxKind.ThrowStatement:
1227-
case SyntaxKind.SwitchStatement:
12281226
return (<ExpressionStatement>parent).expression === node;
12291227
case SyntaxKind.ForStatement:
12301228
const forStatement = <ForStatement>parent;

src/compiler/visitor.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,10 +1148,6 @@ namespace ts {
11481148
result = reduceNode((<AsExpression>node).type, cbNode, result);
11491149
break;
11501150

1151-
case SyntaxKind.NonNullExpression:
1152-
result = reduceNode((<NonNullExpression>node).expression, cbNode, result);
1153-
break;
1154-
11551151
// Misc
11561152
case SyntaxKind.TemplateSpan:
11571153
result = reduceNode((<TemplateSpan>node).expression, cbNode, result);

src/services/services.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ namespace ts {
657657
case SyntaxKind.ImportEqualsDeclaration:
658658
case SyntaxKind.ExportSpecifier:
659659
case SyntaxKind.ImportSpecifier:
660-
case SyntaxKind.ImportEqualsDeclaration:
661660
case SyntaxKind.ImportClause:
662661
case SyntaxKind.NamespaceImport:
663662
case SyntaxKind.GetAccessor:

0 commit comments

Comments
 (0)