.func = (_envset_func)check_cdef,
.scope = scope,
.flag = tflag_check};
- struct ResolverArgs ra = {
- .v = v, .e = exp, .tmpl_name = tmpl_name, .types = types};
- CHECK_O(envset_pushv(&es, v));
- (void)env_push(env, v->from->owner_class, v->from->owner);
+ envset_pushf(&es, v);//);
const Tmpl *tmpl = v->from->owner_class && v->from->owner_class->info->cdef ?
get_tmpl(v->from->owner_class) : NULL;
if(tmpl)
(void)template_push_types(env, tmpl);
+ struct ResolverArgs ra = {
+ .v = v, .e = exp, .tmpl_name = tmpl_name, .types = types};
const bool is_clos = isa(exp->func->type, env->gwion->type[et_closure]);
const Func m_func = !is_clos ? func_match(env, &ra)
: fptr_match(env, &ra);
if(tmpl)
nspc_pop_type(env->gwion->mp, env->curr);
- env_pop(env, scope);
- envset_pop(&es, v->from->owner_class);
+ envset_popf(&es, v);
env->func = former;
return m_func;
}
TmplArg arg = *mp_vector_at(tl, TmplArg, i);
if(unlikely(spec->td)) {
if(unlikely(arg.type == tmplarg_td))
- ERR_O(exp_self(exp)->loc, "expected contant, not type");
- // check argument in call exp
+ ERR_O(exp_self(exp)->loc, "expected constant, not type");
continue;
} else {
if(unlikely(arg.type == tmplarg_exp)) {
ERR_O(exp_self(exp)->loc, "expected type, not constant");
- // check argument in call exp?
continue;
}
DECL_O(const Type, t, = known_type(env, arg.d.td));
bool ok = true;
for(m_uint i = 0; i < l->len; i++) {
Stmt* stmt = mp_vector_at(l, Stmt, i);
+ if(stmt->poison) continue;
if(!scan1_stmt_match_case(env, &stmt->d.stmt_match))
POISON_NODE(ok, env, stmt);
}
return ok;
}
-ANN static inline int actual(const Tmpl *tmpl) {
- return tmpl->call && tmpl->call != (TmplArg_List)1 && tmpl->list;
-}
-
-ANN static inline bool tmpl_push(const Env env, const Tmpl *tmpl) {
- return actual(tmpl) ? template_push_types(env, tmpl) : true;
+ANN static inline void _push(const Env env, const Class_Def c) {
+ env_push_type(env, c->base.type);
+ if (c->base.tmpl)
+ template_push_types(env, c->base.tmpl);
}
ANN static inline void _pop(const Env env, const Class_Def c, const m_uint s) {
- if (c->base.tmpl && actual(c->base.tmpl))
+ if (c->base.tmpl)
nspc_pop_type(env->gwion->mp, env->curr);
env_pop(env, s);
}
ANN bool scanx_body(const Env env, const Class_Def c, const _envset_func f,
void *d) {
- const m_int scope = env_push_type(env, c->base.type);
- if(c->base.tmpl) CHECK_B(tmpl_push(env, c->base.tmpl));
+ const m_int scope = env->scope->depth;
+ _push(env, c);
const bool ret = _body(d, c->body, f);
_pop(env, c, scope);
return ret;