@@ -244,27 +244,25 @@ namespace ts {
244244 isFunctionLike ( node . parent ) && ( < FunctionLikeDeclaration > node . parent ) . name === node ;
245245 }
246246
247- export function isLiteralNameOfPropertyDeclarationOrIndexAccess ( node : Node ) : boolean {
248- if ( node . kind === SyntaxKind . StringLiteral || node . kind === SyntaxKind . NumericLiteral ) {
249- switch ( node . parent . kind ) {
250- case SyntaxKind . PropertyDeclaration :
251- case SyntaxKind . PropertySignature :
252- case SyntaxKind . PropertyAssignment :
253- case SyntaxKind . EnumMember :
254- case SyntaxKind . MethodDeclaration :
255- case SyntaxKind . MethodSignature :
256- case SyntaxKind . GetAccessor :
257- case SyntaxKind . SetAccessor :
258- case SyntaxKind . ModuleDeclaration :
259- return getNameOfDeclaration ( < Declaration > node . parent ) === node ;
260- case SyntaxKind . ElementAccessExpression :
261- return ( < ElementAccessExpression > node . parent ) . argumentExpression === node ;
262- case SyntaxKind . ComputedPropertyName :
263- return true ;
264- }
247+ export function isLiteralNameOfPropertyDeclarationOrIndexAccess ( node : StringLiteral | NumericLiteral ) : boolean {
248+ switch ( node . parent . kind ) {
249+ case SyntaxKind . PropertyDeclaration :
250+ case SyntaxKind . PropertySignature :
251+ case SyntaxKind . PropertyAssignment :
252+ case SyntaxKind . EnumMember :
253+ case SyntaxKind . MethodDeclaration :
254+ case SyntaxKind . MethodSignature :
255+ case SyntaxKind . GetAccessor :
256+ case SyntaxKind . SetAccessor :
257+ case SyntaxKind . ModuleDeclaration :
258+ return getNameOfDeclaration ( < Declaration > node . parent ) === node ;
259+ case SyntaxKind . ElementAccessExpression :
260+ return ( < ElementAccessExpression > node . parent ) . argumentExpression === node ;
261+ case SyntaxKind . ComputedPropertyName :
262+ return true ;
263+ case SyntaxKind . LiteralType :
264+ return node . parent . parent . kind === SyntaxKind . IndexedAccessType ;
265265 }
266-
267- return false ;
268266 }
269267
270268 export function isExpressionOfExternalModuleImportEqualsDeclaration ( node : Node ) {
0 commit comments