Type prefix = ((Type.TypeRef)type).pre;
Type prefix = ((Type.SingleType)type).pre;
    public Type apply(Type type) {        switch (type) {        case TypeRef(ThisType(_), Symbol symbol, Type[] args): {            Object value = types.get(symbol);            if (value != null) return (Type)value;            value = symbols.get(symbol);            if (value == null) return super.map(type);            Type prefix = ((Type.TypeRef)type).pre;            return Type.typeRef(apply(prefix), (Symbol)value, map(args));        }        case SingleType(ThisType(_), Symbol symbol): {            Object value = types.get(symbol);            if (value != null) return (Type)value;            value = symbols.get(symbol);            if (value == null) return super.map(type);            Type prefix = ((Type.TypeRef)type).pre;            return Type.singleType(apply(prefix), (Symbol)value);        }            // TODO what should we do with PolyTypes?        default:            return super.map(type);        }    }