emit_member(emit, value, exp_getvar(exp_self(member)));
else
emit_struct_data(emit, value, exp_getvar(exp_self(member)));
- } else if (GET_FLAG(value, static))
+ } else {
+ assert(GET_FLAG(value, static));
emit_dot_static_import_data(emit, value, exp_getvar(exp_self(member)));
- else exit(3); //emit_pushimm(emit, (m_uint)value->type);
+ }
if(isa(value->type, emit->gwion->type[et_object]) > 0 &&
!exp_getvar(exp_self(member)) &&
(GET_FLAG(value, static) || GET_FLAG(value, late)))
}
if (tmpl_base(cdef->base.tmpl)) return get_parent_base(env, cdef->base.ext);
const bool tmpl = !!cdef->base.tmpl;
- if (tmpl) template_push_types(env, cdef->base.tmpl);
+ if (tmpl) CHECK_BO(template_push_types(env, cdef->base.tmpl));
const Type t = scan0_final(env, cdef->base.ext);
if (tmpl) nspc_pop_type(env->gwion->mp, env->curr);
return t;
for(uint32_t i = tmpl->list->len - 1; i < tmpl->call->len; i++) {
fseek(f, 0, SEEK_SET);
const TmplArg targ = *mp_vector_at(tmpl->call, TmplArg, i);
- // skip or error on const?
- // or do smth else?
+ // post spread const expression won't reach here
+ assert(targ.type == tmplarg_td);
DECL_OB(const Type, t, = known_type(env, targ.d.td));
struct AstGetter_ arg = {env->name, f, env->gwion->st, .ppa = env->gwion->ppa};
const m_str type = type2str(env->gwion, t, targ.d.td->tag.loc);
{
++offset;
break;
- }
- mp_vector_add(env->gwion->mp, &new_body, Section, section);
+ }
+ mp_vector_add(env->gwion->mp, &new_body, Section, section);
}
} else {
if(!acc)
const Stmt stmt = *mp_vector_at(list, Stmt, j);
mp_vector_add(env->gwion->mp, &new_body, Stmt, stmt);
}
- break;
}
} else {
mp_vector_add(env->gwion->mp, &new_body, Stmt, stmt);
return !strcmp(s_name(spec->tag.sym), "...");
}
+
ANN2(1,2) m_bool check_tmpl(const Env env, const TmplArg_List tl, const Specialized_List sl, const loc_t loc, const bool is_spread) {
if (!sl || sl->len > tl->len || (tl->len != sl->len && !is_spread))
ERR_B(loc, "invalid template type number");
for (uint32_t i = 0; i < sl->len; i++) {
- TmplArg *arg = mp_vector_at(tl, TmplArg, i);
+ TmplArg *targ = mp_vector_at(tl, TmplArg, i);
Specialized *spec = mp_vector_at(sl, Specialized, i);
- if(arg->type == tmplarg_td) {
+ if(targ->type == tmplarg_td) {
if(spec->td) {
- Type_Decl *base = arg->d.td;
+ Type_Decl *base = targ->d.td;
Type_Decl *next = base;
Type_Decl *last = next->next;
while(next && last) {
next->next = NULL;
const Type t = known_type(env, base);
if(t) {
- arg->type = tmplarg_exp;
+ targ->type = tmplarg_exp;
Exp* e = new_exp_td(env->gwion->mp, base, base->tag.loc);
- arg->d.exp = new_exp_dot(env->gwion->mp, e, last->tag.sym, base->tag.loc);
+ targ->d.exp = new_exp_dot(env->gwion->mp, e, last->tag.sym, base->tag.loc);
free_type_decl(env->gwion->mp, last);
i--;
continue;
spec->td ? "constant" : "type");
}
- DECL_OB(const Type, t, = known_type(env, arg->d.td));
+ DECL_OB(const Type, t, = known_type(env, targ->d.td));
if(spec->traits) {
Symbol missing = miss_traits(t, spec);
if (missing) {
Specialized_List sl = tmpl
? tmpl->list : NULL;
const bool is_spread = is_spread_tmpl(tmpl);
- if(!single_variadic) CHECK_BO(check_tmpl(env, tl, sl, td->tag.loc, is_spread));
+ if(!single_variadic)
+ CHECK_BO(check_tmpl(env, tl, sl, td->tag.loc, is_spread));
struct Op_Import opi = {.op = insert_symbol("class"),
.lhs = t,
.data = (uintptr_t)&ts,