From: fennecdjay Date: Tue, 22 Oct 2019 15:25:31 +0000 (+0200) Subject: :art: Make imported template func have array if needef X-Git-Tag: nightly~2116^2~33 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=d90023b8aee392c50e4ba65aa34a4205a272299c;p=gwion.git :art: Make imported template func have array if needef --- diff --git a/src/lib/import.c b/src/lib/import.c index 8a63647c..a307d7d7 100644 --- a/src/lib/import.c +++ b/src/lib/import.c @@ -576,6 +576,8 @@ ANN2(1) static Func_Def template_fdef(const Gwi gwi, const struct func_checker * const Arg_List arg_list = make_dll_arg_list(gwi, &gwi->func); m_uint depth; Type_Decl *td = str2decl(gwi->gwion->env, gwi->func.type, &depth, gwi->loc); + if(depth) + td->array = make_dll_arg_list_array(gwi->gwion->mp, NULL, &depth, 0); const Func_Def fdef = new_func_def(gwi->gwion->mp, new_func_base(gwi->gwion->mp, td, insert_symbol(gwi->gwion->st, ck->name), arg_list), NULL, ae_flag_builtin, loc_cpy(gwi->gwion->mp, gwi->loc)); fdef->base->tmpl = new_tmpl(gwi->gwion->mp, ck->tmpl, -1); diff --git a/tests/import/func_tmpl.c b/tests/import/func_tmpl.c index fddf4d50..a463cc1b 100644 --- a/tests/import/func_tmpl.c +++ b/tests/import/func_tmpl.c @@ -17,7 +17,7 @@ static SFUN(func_tmpl_xfun) { } GWION_IMPORT(func_tmpl) { - GWI_BB(gwi_func_ini(gwi, "void", "<~A~>test", func_tmpl_xfun)) + GWI_BB(gwi_func_ini(gwi, "int[]", "<~A~>test", func_tmpl_xfun)) GWI_BB(gwi_func_arg(gwi, "A", "i")) GWI_BB(gwi_func_end(gwi, 0)) return GW_OK;