From: fennecdjay Date: Wed, 3 Jul 2019 14:21:29 +0000 (+0200) Subject: :art: Allow func named as types X-Git-Tag: nightly~2381^2~7 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=cf8eaddbeaab6956dcd6ae0edfacc9b3f2f2e157;p=gwion.git :art: Allow func named as types --- diff --git a/src/parse/scan2.c b/src/parse/scan2.c index b09ce505..25b536af 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -522,9 +522,9 @@ ANN2(1,2) m_bool scan2_fdef(const Env env, const Func_Def f, const Value overloa ANN m_bool scan2_func_def(const Env env, const Func_Def f) { const m_uint scope = !GET_FLAG(f, global) ? env->scope->depth : env_push_global(env); const Value overload = nspc_lookup_value0(env->curr, f->base->xid); - const Value res = nspc_lookup_value1(env->global_nspc, f->base->xid); - if(res) - ERR_B(f->pos, _("'%s' already declared as type"), s_name(f->base->xid)) +// const Value res = nspc_lookup_value1(env->global_nspc, f->base->xid); +// if(res) +// ERR_B(f->pos, _("'%s' already declared as type"), s_name(f->base->xid)) f->stack_depth = (env->class_def && !GET_FLAG(f, static) && !GET_FLAG(f, global)) ? SZ_INT : 0; if(GET_FLAG(f, variadic)) f->stack_depth += SZ_INT;