]> Nishi Git Mirror - gwion.git/commitdiff
:art: Fex fixes
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 9 Jun 2019 16:42:14 +0000 (18:42 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 9 Jun 2019 16:42:45 +0000 (18:42 +0200)
src/lib/func.c
src/lib/vararg.c

index 22a9d7a19b51d808a7626ee0d4ebf47d31321c6d..70efd95efb3d7309591330ba81b253252d040604 100644 (file)
@@ -15,6 +15,7 @@
 #include "nspc.h"
 #include "operator.h"
 #include "traverse.h"
+#include "template.h"
 #include "parse.h"
 
 ANN Type check_exp_call1(const Env env, const Exp_Call *exp);
@@ -67,14 +68,13 @@ ANN static m_bool fptr_tmpl_push(const Env env, struct FptrInfo *info) {
     return GW_OK;
   ID_List t0 = info->lhs->def->base->tmpl->list,
           t1 = info->rhs->def->base->tmpl->list;
-  nspc_push_type(env->gwion->mp, env->curr);
   while(t0) {
     CHECK_OB(t1)
-    nspc_add_type(env->curr, t0->xid, t_undefined);
-    nspc_add_type(env->curr, t1->xid, t_undefined);
     t0 = t0->next;
     t1 = t1->next;
   }
+  CHECK_BB(template_push_types(env, info->lhs->def->base->tmpl))
+  CHECK_BB(template_push_types(env, info->rhs->def->base->tmpl))
   return GW_OK;
 }
 
index 226f81bf22d23142184a9d16b98443cc105d4f64..47b5dda8d31aaeefc83213c522d1f2e49d110855 100644 (file)
@@ -56,7 +56,7 @@ INSTR(VarargEnd) {
 }
 
 INSTR(VarargMember) {
-  const struct Vararg_* arg = *(struct Vararg_**)MEM(instr->m_val);
+  struct Vararg_* arg = *(struct Vararg_**)MEM(instr->m_val);
   if(instr->m_val2 != arg->k[arg->i]) { // TODO: differnciate object and primitives
     free_vararg(shred->info->mp, arg);
     Except(shred, "InvalidVariadicAccess");