File tree 1 file changed +11
-13
lines changed
1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -7494,27 +7494,25 @@ module ts {
7494
7494
7495
7495
if ( e . kind === SyntaxKind . Identifier ) {
7496
7496
// unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work.
7497
- // instead pick symbol that correspond of enum declaration and later try to fetch member from the symbol
7497
+ // instead pick current enum type and later try to fetch member from the type
7498
7498
enumType = currentType ;
7499
7499
propertyName = ( < Identifier > e ) . text ;
7500
7500
}
7501
- else if ( e . kind === SyntaxKind . IndexedAccess ) {
7502
- if ( ( < IndexedAccess > e ) . index . kind !== SyntaxKind . StringLiteral ) {
7503
- return undefined ;
7501
+ else {
7502
+ if ( e . kind === SyntaxKind . IndexedAccess ) {
7503
+ if ( ( < IndexedAccess > e ) . index . kind !== SyntaxKind . StringLiteral ) {
7504
+ return undefined ;
7505
+ }
7506
+ var enumType = getTypeOfNode ( ( < IndexedAccess > e ) . object ) ;
7507
+ propertyName = ( < LiteralExpression > ( < IndexedAccess > e ) . index ) . text ;
7504
7508
}
7505
- var enumType = getTypeOfNode ( ( < IndexedAccess > e ) . object ) ;
7506
- if ( enumType !== currentType ) {
7507
- return undefined ;
7509
+ else {
7510
+ var enumType = getTypeOfNode ( ( < PropertyAccess > e ) . left ) ;
7511
+ propertyName = ( < PropertyAccess > e ) . right . text ;
7508
7512
}
7509
- propertyName = ( < LiteralExpression > ( < IndexedAccess > e ) . index ) . text ;
7510
- }
7511
- else {
7512
- // left part in PropertyAccess should be resolved to the symbol of enum that declared 'member'
7513
- var enumType = getTypeOfNode ( ( < PropertyAccess > e ) . left ) ;
7514
7513
if ( enumType !== currentType ) {
7515
7514
return undefined ;
7516
7515
}
7517
- propertyName = ( < PropertyAccess > e ) . right . text ;
7518
7516
}
7519
7517
7520
7518
if ( propertyName === undefined ) {
You can’t perform that action at this time.
0 commit comments