From: fennecdjay Date: Tue, 1 Oct 2019 18:23:24 +0000 (+0200) Subject: :fire: Use of subscript check X-Git-Tag: nightly~2198^2~207 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=f78b863513d0f7959a48e01a542041e615b83143;p=gwion.git :fire: Use of subscript check --- diff --git a/src/parse/check.c b/src/parse/check.c index 0435deb6..92d200d3 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -38,12 +38,11 @@ ANN static m_bool check_implicit(const Env env, const m_str str, return GW_OK; } -ANN m_bool check_exp_array_subscripts(const Env env, const Exp exp) { +ANN m_bool check_exp_array_subscripts(Env env, Exp exp) { CHECK_OB(check_exp(env, exp)) - const Type t = env->gwion->type[et_int]; - Exp e = exp; - do CHECK_BB(check_implicit(env, "@access", e, t)) - while((e = e->next)); + do if(isa(exp->type, env->gwion->type[et_int]) < 0) + ERR_B(exp->pos, _("incompatible array subscript type '%s' ..."), exp->type->name) + while((exp = exp->next)); return GW_OK; }