langtools/src/share/classes/com/sun/tools/javac/code/Types.java
changeset 326 d51f30ce6796
parent 162 6620f2a8e265
child 514 3942d9cdc81c
equal deleted inserted replaced
325:44df0e9643b4 326:d51f30ce6796
  1296             public Type visitClassType(ClassType t, Symbol sym) {
  1296             public Type visitClassType(ClassType t, Symbol sym) {
  1297                 if (t.tsym == sym)
  1297                 if (t.tsym == sym)
  1298                     return t;
  1298                     return t;
  1299 
  1299 
  1300                 Type st = supertype(t);
  1300                 Type st = supertype(t);
  1301                 if (st.tag == CLASS || st.tag == ERROR) {
  1301                 if (st.tag == CLASS || st.tag == TYPEVAR || st.tag == ERROR) {
  1302                     Type x = asSuper(st, sym);
  1302                     Type x = asSuper(st, sym);
  1303                     if (x != null)
  1303                     if (x != null)
  1304                         return x;
  1304                         return x;
  1305                 }
  1305                 }
  1306                 if ((sym.flags() & INTERFACE) != 0) {
  1306                 if ((sym.flags() & INTERFACE) != 0) {
  1318                 return isSubtype(t, sym.type) ? sym.type : null;
  1318                 return isSubtype(t, sym.type) ? sym.type : null;
  1319             }
  1319             }
  1320 
  1320 
  1321             @Override
  1321             @Override
  1322             public Type visitTypeVar(TypeVar t, Symbol sym) {
  1322             public Type visitTypeVar(TypeVar t, Symbol sym) {
  1323                 return asSuper(t.bound, sym);
  1323                 if (t.tsym == sym)
       
  1324                     return t;
       
  1325                 else
       
  1326                     return asSuper(t.bound, sym);
  1324             }
  1327             }
  1325 
  1328 
  1326             @Override
  1329             @Override
  1327             public Type visitErrorType(ErrorType t, Symbol sym) {
  1330             public Type visitErrorType(ErrorType t, Symbol sym) {
  1328                 return t;
  1331                 return t;