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; |