a->xid = src->xid; // 1
if(src->next)
a->next = cpy_id_list(p, src->next); // 1
- a->pos = loc_cpy(p, src->pos); // 1
+ if(src->pos)
+ a->pos = loc_cpy(p, src->pos); // 1
return a;
}
CHECK_BB(scan1_exp(env, var->array->exp))
}
t = array_type(env, decl->type, var->array->depth);
- } else if(GET_FLAG(t, abstract) && !GET_FLAG(decl->td, ref))
+ } else if(GET_FLAG(t, abstract) && !GET_FLAG(decl->td, ref))
ERR_B(exp_self(decl)->pos, _("Type '%s' is abstract, declare as ref. (use @)"), t->name)
CHECK_OB(prim_ref(env, t, decl->td))
//assert(!var->value);
if(!overload) {
ADD_REF(v);
nspc_add_value(env->curr, f->def->base->xid, v);
- } else {
- assert(overload->d.func_ref);
+ } else if(overload->d.func_ref) {
f->next = overload->d.func_ref->next;
overload->d.func_ref->next = f;
}
ANN Type prim_ref(const Env env, const Type t, const Type_Decl* td) {
if(GET_FLAG(td, ref) && isa(t, t_object) < 0 && isa(t, t_class) < 0)
- ERR_O(td->xid->pos, _("primitive types cannot be used as reference (@)...\n"))
+ ERR_O(td_pos(td), _("primitive types cannot be used as reference (@)...\n"))
return t;
}