return GW_OK;
}
-ANN static inline m_uint _push(const Env e, const Class_Def c) {
- const m_uint scope = env_push_type(e, c->base.type);
- if(c->tmpl)
- template_push_types(e, c->tmpl->list.list, c->tmpl->base);
+ANN static inline m_int _push(const Env env, const Class_Def c) {
+ const m_uint scope = env_push_type(env, c->base.type);
+ if(c->tmpl) {
+ if(!c->tmpl->base)
+ ERR_B(c->pos,
+ "you must provide template types for type '%s'", s_name(c->base.xid))
+ CHECK_BB(template_push_types(env, c->tmpl->list.list, c->tmpl->base))
+ }
return scope;
}
ANN m_bool
scanx_body(const Env e, const Class_Def c, const _exp_func f, void* d) {
- const m_uint scope = _push(e, c);
+ const m_int scope = _push(e, c);
+ CHECK_BB(scope)
const m_bool ret = _body(d, c->body, f);
_pop(e, c, scope);
return ret;
if(GET_FLAG(t, template)) {
if(GET_FLAG(t, ref))
return t;
- if(!type->types)
- ERR_O(type->xid->pos,
- "you must provide template types for type '%s'", t->name)
if(template_match(t->e->def->tmpl->list.list, type->types) < 0)
ERR_O(type->xid->pos, "invalid template types number")
const Class_Def a = template_class(env, t->e->def, type->types);