Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 53d3f29

Browse filesBrowse files
committed
Remove hasTypeArguments
This internal utility function and corresponding type weren't in use, and `hasTypeArguments`'s guarding was buggy: - `node` could be a `NodeWithTypeArguments`, which is not a member of `HasTypeArguments` - else branch narrowing was wrong: `typeArguments` is optional, so it can be undefined while `node` is assignable to `HasTypeArguments`
1 parent b504a1e commit 53d3f29
Copy full SHA for 53d3f29

File tree

Expand file treeCollapse file tree

3 files changed

+0
-14
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+0
-14
lines changed

‎src/compiler/types.ts

Copy file name to clipboardExpand all lines: src/compiler/types.ts
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,13 +1293,6 @@ export type HasIllegalTypeParameters =
12931293
| SetAccessorDeclaration
12941294
| GetAccessorDeclaration;
12951295

1296-
export type HasTypeArguments =
1297-
| CallExpression
1298-
| NewExpression
1299-
| TaggedTemplateExpression
1300-
| JsxOpeningElement
1301-
| JsxSelfClosingElement;
1302-
13031296
export type HasInitializer =
13041297
| HasExpressionInitializer
13051298
| ForStatement

‎src/compiler/utilities.ts

Copy file name to clipboardExpand all lines: src/compiler/utilities.ts
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ import {
222222
HasModifiers,
223223
hasProperty,
224224
HasType,
225-
HasTypeArguments,
226225
HeritageClause,
227226
Identifier,
228227
identifierToKeywordKind,
@@ -4751,11 +4750,6 @@ export function getTypeParameterFromJsDoc(node: TypeParameterDeclaration & { par
47514750
return typeParameters && find(typeParameters, p => p.name.escapedText === name);
47524751
}
47534752

4754-
/** @internal @knipignore */
4755-
export function hasTypeArguments(node: Node): node is HasTypeArguments {
4756-
return !!(node as HasTypeArguments).typeArguments;
4757-
}
4758-
47594753
/** @internal */
47604754
export const enum AssignmentKind {
47614755
None,

‎tests/baselines/reference/api/typescript.d.ts

Copy file name to clipboardExpand all lines: tests/baselines/reference/api/typescript.d.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4392,7 +4392,6 @@ declare namespace ts {
43924392
| WhileStatement
43934393
| WithStatement;
43944394
type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
4395-
type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
43964395
type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
43974396
type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | EnumMember;
43984397
type HasDecorators = ParameterDeclaration | PropertyDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ClassExpression | ClassDeclaration;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.