code: public Type asEnclosingSuper(Type t, Symbol sym) {
          switch (t.getTag()) {
          case CLASS:
              do {
                  Type s = asSuper(t, sym);
                  if (s != null) return s;
                  Type outer = t.getEnclosingType();
                  t = (outer.hasTag(CLASS)) ? outer :
                      (t.tsym.owner.enclClass() != null) ? t.tsym.owner.enclClass().type :
                      Type.noType;
              } while (t.hasTag(CLASS));
              return null;
          case ARRAY:
              return isSubtype(t, sym.type) ? sym.type : null;
          case TYPEVAR:
              return asSuper(t, sym);
          case ERROR:
              return t;
          default:
              return null;
          }
      }
docs: Return the base type of t or any of its enclosing types that
  starts with the given symbol.  If none exists, return null.
  
  @param t a type
  @param sym a symbol