*  @param a             The type that should be bounded by bs.
     *  @param bs            The bound.
     */
    private void checkExtends(DiagnosticPosition pos, Type a, TypeVar bs) {
        if (a.isUnbound()) {
            return;
        } else if (a.tag != WILDCARD) {
            a = types.upperBound(a);
            for (List<Type> l = types.getBounds(bs); l.nonEmpty(); l = l.tail) {
                if (!types.isSubtype(a, l.head)) {
                    log.error(pos, "not.within.bounds", a);
                    return;
                }
            }
        } else if (a.isExtendsBound()) {
            if (!types.isCastable(bs.getUpperBound(), types.upperBound(a), Warner.noWarnings))
                log.error(pos, "not.within.bounds", a);
        } else if (a.isSuperBound()) {
            if (types.notSoftSubtype(types.lowerBound(a), bs.getUpperBound()))
                log.error(pos, "not.within.bounds", a);
        }
    }