2214 private void checkNonCyclic1(DiagnosticPosition pos, Type t, List<TypeVar> seen) { |
2214 private void checkNonCyclic1(DiagnosticPosition pos, Type t, List<TypeVar> seen) { |
2215 final TypeVar tv; |
2215 final TypeVar tv; |
2216 if (t.hasTag(TYPEVAR) && (t.tsym.flags() & UNATTRIBUTED) != 0) |
2216 if (t.hasTag(TYPEVAR) && (t.tsym.flags() & UNATTRIBUTED) != 0) |
2217 return; |
2217 return; |
2218 if (seen.contains(t)) { |
2218 if (seen.contains(t)) { |
2219 tv = (TypeVar)t; |
2219 tv = (TypeVar)t.unannotatedType(); |
2220 tv.bound = types.createErrorType(t); |
2220 tv.bound = types.createErrorType(t); |
2221 log.error(pos, "cyclic.inheritance", t); |
2221 log.error(pos, "cyclic.inheritance", t); |
2222 } else if (t.hasTag(TYPEVAR)) { |
2222 } else if (t.hasTag(TYPEVAR)) { |
2223 tv = (TypeVar)t; |
2223 tv = (TypeVar)t.unannotatedType(); |
2224 seen = seen.prepend(tv); |
2224 seen = seen.prepend(tv); |
2225 for (Type b : types.getBounds(tv)) |
2225 for (Type b : types.getBounds(tv)) |
2226 checkNonCyclic1(pos, b, seen); |
2226 checkNonCyclic1(pos, b, seen); |
2227 } |
2227 } |
2228 } |
2228 } |