diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 352e6843a8295..16638633fac9b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9645,7 +9645,8 @@ namespace ts { } else { stringIndexInfo = baseConstructorIndexInfo; - if (symbol.flags & SymbolFlags.Enum && (getDeclaredTypeOfSymbol(symbol).flags & TypeFlags.Enum || some(type.properties, prop => !!(getTypeOfSymbol(prop).flags & TypeFlags.NumberLike))) ) { + if (symbol.flags & SymbolFlags.Enum && (getDeclaredTypeOfSymbol(symbol).flags & TypeFlags.Enum || + some(type.properties, prop => !!(getTypeOfSymbol(prop).flags & TypeFlags.NumberLike)))) { numberIndexInfo = enumNumberIndexInfo; } } @@ -9680,7 +9681,7 @@ namespace ts { const declaration = getIndexDeclarationOfIndexSymbol(indexSymbol, indexKind); if (!declaration) return undefined; return createIndexInfo(declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, - hasModifier(declaration, ModifierFlags.Readonly), declaration); + hasModifier(declaration, ModifierFlags.Readonly), declaration); } function resolveReverseMappedTypeMembers(type: ReverseMappedType) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 6a85b4a3b08cb..ae13b11389779 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2824,10 +2824,6 @@ namespace ts { } function isIndexSignature(): boolean { - return token() === SyntaxKind.StaticKeyword ? lookAhead(isNonStaticIndexSignature) : isNonStaticIndexSignature() - } - - function isNonStaticIndexSignature(): boolean { return token() === SyntaxKind.OpenBracketToken && lookAhead(isUnambiguouslyIndexSignature); } @@ -2888,7 +2884,6 @@ namespace ts { function parseIndexSignatureDeclaration(node: IndexSignatureDeclaration): IndexSignatureDeclaration { node.kind = SyntaxKind.IndexSignature; - node.staticModifier = parseOptionalToken(SyntaxKind.StaticKeyword); node.parameters = parseBracketedList(ParsingContext.Parameters, parseParameter, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e0fa8af7352da..3add4e354ae28 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1184,7 +1184,6 @@ namespace ts { export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; parent: ObjectTypeDeclaration; - staticModifier?: Token; } export interface TypeNode extends Node { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index bf37d5204be73..0ba337629e70b 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -752,7 +752,6 @@ declare namespace ts { export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; parent: ObjectTypeDeclaration; - staticModifier?: Token; } export interface TypeNode extends Node { _typeNodeBrand: any; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 7673c6c44ffa6..06e81bd224a91 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -752,7 +752,6 @@ declare namespace ts { export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; parent: ObjectTypeDeclaration; - staticModifier?: Token; } export interface TypeNode extends Node { _typeNodeBrand: any;