private void checkNonCyclic1(DiagnosticPosition pos, Type t, Set<TypeVar> seen) {
        final TypeVar tv;
        if (seen.contains(t)) {
            tv = (TypeVar)t;
            tv.bound = new ErrorType();
            log.error(pos, "cyclic.inheritance", t);
        } else if (t.tag == TYPEVAR) {
            tv = (TypeVar)t;
            seen.add(tv);
            for (Type b : types.getBounds(tv))
                checkNonCyclic1(pos, b, seen);
        }
    }