code: protected ICompilableTypeInternal isMemberOnEnclosingType(IReducedSymbol symbol)
    {
      if( !_cc().isNonStaticInnerClass() )
      {
        return null;
      }
  
      // If the symbol is on this class, or any ancestors, it's not enclosed
      //noinspection SuspiciousMethodCalls
      IType symbolClass = maybeUnwrapProxy( symbol.getGosuClass() );
      if( getGosuClass().getAllTypesInHierarchy().contains( symbolClass ) )
      {
        return null;
      }
  
      ICompilableTypeInternal enclosingClass = _cc().getEnclosingType();
  
      if( !(TypeLord.getOuterMostEnclosingClass( _cc().getEnclosingType() ) instanceof IGosuEnhancement) &&
          symbolClass instanceof IGosuEnhancement )
      {
        symbolClass = ((IGosuEnhancement)symbolClass).getEnhancedType();
      }
  
      while( enclosingClass != null )
      {
        //noinspection SuspiciousMethodCalls
        if( enclosingClass.getAllTypesInHierarchy().contains( symbolClass ) )
        {
          return enclosingClass;
        }
        enclosingClass = enclosingClass.getEnclosingType();
      }
  
      return null;
    }
docs: class OR is defined on a supertype or interface of an enclosing class