@@ -1440,8 +1440,10 @@ export class Resolver extends DiagnosticEmitter {
14401440 case ElementKind . InterfacePrototype :
14411441 case ElementKind . Class :
14421442 case ElementKind . Interface : {
1443+ let classLikeTarget = target ;
1444+ let findBase = false ;
14431445 do {
1444- let member = target . getMember ( propertyName ) ;
1446+ let member = classLikeTarget . getMember ( propertyName ) ;
14451447 if ( member ) {
14461448 if ( member . kind == ElementKind . PropertyPrototype ) {
14471449 let propertyInstance = this . resolveProperty ( < PropertyPrototype > member , reportMode ) ;
@@ -1458,34 +1460,32 @@ export class Resolver extends DiagnosticEmitter {
14581460 this . currentElementExpression = null ;
14591461 return member ; // instance FIELD, static GLOBAL, FUNCTION_PROTOTYPE, PROPERTY...
14601462 }
1461- // traverse inherited static members on the base prototype if target is a class prototype
1462- if (
1463- target . kind == ElementKind . ClassPrototype ||
1464- target . kind == ElementKind . InterfacePrototype
1465- ) {
1466- let classPrototype = < ClassPrototype > target ;
1467- let basePrototype = classPrototype . basePrototype ;
1468- if ( basePrototype ) {
1469- target = basePrototype ;
1470- } else {
1463+ findBase = false ;
1464+ switch ( classLikeTarget . kind ) {
1465+ case ElementKind . ClassPrototype :
1466+ case ElementKind . InterfacePrototype : {
1467+ // traverse inherited static members on the base prototype if target is a class prototype
1468+ let classPrototype = < ClassPrototype > classLikeTarget ;
1469+ let basePrototype = classPrototype . basePrototype ;
1470+ if ( basePrototype ) {
1471+ findBase = true ;
1472+ classLikeTarget = basePrototype ;
1473+ }
14711474 break ;
14721475 }
1473- // traverse inherited instance members on the base class if target is a class instance
1474- } else if (
1475- target . kind == ElementKind . Class ||
1476- target . kind == ElementKind . Interface
1477- ) {
1478- let classInstance = < Class > target ;
1479- let baseInstance = classInstance . base ;
1480- if ( baseInstance ) {
1481- target = baseInstance ;
1482- } else {
1476+ case ElementKind . Class :
1477+ case ElementKind . Interface : {
1478+ // traverse inherited instance members on the base class if target is a class instance
1479+ let classInstance = < Class > classLikeTarget ;
1480+ let baseInstance = classInstance . base ;
1481+ if ( baseInstance ) {
1482+ findBase = true ;
1483+ classLikeTarget = baseInstance ;
1484+ }
14831485 break ;
14841486 }
1485- } else {
1486- break ;
14871487 }
1488- } while ( true ) ;
1488+ } while ( findBase ) ;
14891489 break ;
14901490 }
14911491 default : { // enums or other namespace-like elements
0 commit comments