Skip to content

Commit d28fb65

Browse files
author
Andy
authored
Fix type of TypeParameterDeclaration#parent (#25737)
1 parent 89f2af1 commit d28fb65

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/compiler/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ namespace ts {
755755

756756
export interface TypeParameterDeclaration extends NamedDeclaration {
757757
kind: SyntaxKind.TypeParameter;
758-
parent: DeclarationWithTypeParameters | InferTypeNode;
758+
parent: DeclarationWithTypeParameterChildren | InferTypeNode;
759759
name: Identifier;
760760
constraint?: TypeNode;
761761
default?: TypeNode;
@@ -2036,7 +2036,8 @@ namespace ts {
20362036

20372037
export type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode;
20382038

2039-
export type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
2039+
export type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
2040+
export type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
20402041

20412042
export interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
20422043
kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression;

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ declare namespace ts {
545545
}
546546
interface TypeParameterDeclaration extends NamedDeclaration {
547547
kind: SyntaxKind.TypeParameter;
548-
parent: DeclarationWithTypeParameters | InferTypeNode;
548+
parent: DeclarationWithTypeParameterChildren | InferTypeNode;
549549
name: Identifier;
550550
constraint?: TypeNode;
551551
default?: TypeNode;
@@ -1317,7 +1317,8 @@ declare namespace ts {
13171317
block: Block;
13181318
}
13191319
type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode;
1320-
type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
1320+
type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
1321+
type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
13211322
interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
13221323
kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression;
13231324
name?: Identifier;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ declare namespace ts {
545545
}
546546
interface TypeParameterDeclaration extends NamedDeclaration {
547547
kind: SyntaxKind.TypeParameter;
548-
parent: DeclarationWithTypeParameters | InferTypeNode;
548+
parent: DeclarationWithTypeParameterChildren | InferTypeNode;
549549
name: Identifier;
550550
constraint?: TypeNode;
551551
default?: TypeNode;
@@ -1317,7 +1317,8 @@ declare namespace ts {
13171317
block: Block;
13181318
}
13191319
type ObjectTypeDeclaration = ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode;
1320-
type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
1320+
type DeclarationWithTypeParameters = DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature;
1321+
type DeclarationWithTypeParameterChildren = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag;
13211322
interface ClassLikeDeclarationBase extends NamedDeclaration, JSDocContainer {
13221323
kind: SyntaxKind.ClassDeclaration | SyntaxKind.ClassExpression;
13231324
name?: Identifier;

0 commit comments

Comments
 (0)