From 3c960f01a7c30d127651b0aa7598bf4b2d175714 Mon Sep 17 00:00:00 2001
From: fennecdjay <fennecdjay@gmail.com>
Date: Sun, 31 Jul 2022 14:31:32 +0200
Subject: [PATCH] :art: pipe to decl

---
 src/parse/check.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/parse/check.c b/src/parse/check.c
index f61233d0..ff80ee37 100644
--- a/src/parse/check.c
+++ b/src/parse/check.c
@@ -138,12 +138,11 @@ ANN static inline m_bool inferable(const Env env, const Type t,
 ANN Type check_exp_decl(const Env env, Exp_Decl *const decl) {
   if (decl->td->array && decl->td->array->exp)
     CHECK_OO(check_exp(env, decl->td->array->exp));
-  if (decl->args && !decl->args->type) { // for some reason this can be parsed twice
-    Exp e = new_exp_unary2(env->gwion->mp, insert_symbol("new"), cpy_type_decl(env->gwion->mp, decl->td), decl->args, decl->td->pos);
+//  if (decl->args && !decl->args->type) { // for some reason this can be parsed twice
+  if (decl->args) {
+    const Exp e = new_exp_unary2(env->gwion->mp, insert_symbol("new"), cpy_type_decl(env->gwion->mp, decl->td), decl->args, decl->td->pos);
     CHECK_OO(check_exp(env, e));
-    Exp args = decl->args;
     decl->args = e;
-    free_exp(env->gwion->mp, args);
   }
   if (decl->td->xid == insert_symbol("auto")) { // should be better
     CHECK_BO(scan1_exp(env, exp_self(decl)));
-- 
2.43.0