]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix stmt_each for [][]... types
authorJérémie Astor <fennecdjay@gmail.com>
Wed, 16 Dec 2020 01:53:58 +0000 (02:53 +0100)
committerJérémie Astor <fennecdjay@gmail.com>
Wed, 16 Dec 2020 01:53:58 +0000 (02:53 +0100)
src/parse/check.c

index f25ddaf0fff9faa7ef891da75916f1d424bf84ac..27aa12546489a552b52e4e2209bdc440ec6f42c2 100644 (file)
@@ -942,6 +942,8 @@ ANN static m_bool do_stmt_each(const Env env, const Stmt_Each stmt) {
   char c[15 + strlen(ptr->name)];
   sprintf(c, "@Foreach:[%s]", ptr->name);
   const Type ret = str2type(env->gwion, c, stmt->exp->pos);
+  if(ptr->array_depth)
+    set_tflag(ret, tflag_typedef);
   stmt->v = new_value(env->gwion->mp, ret, s_name(stmt->sym));
   set_vflag(stmt->v, vflag_valid);
   nspc_add_value(env->curr, stmt->sym, stmt->v);