From: fennecdjay Date: Sun, 3 Nov 2019 23:02:37 +0000 (+0100) Subject: :art: Update X-Git-Tag: nightly~2116^2~10 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=76f5c132bf788960aaa9c61abed6ec6e6718c3d9;p=gwion.git :art: Update --- diff --git a/src/import/tdef.c b/src/import/tdef.c index 100ee825..8f235f58 100644 --- a/src/import/tdef.c +++ b/src/import/tdef.c @@ -34,10 +34,10 @@ ANN Type gwi_typedef_end(const Gwi gwi, const ae_flag flag) { Type_Decl *td = gwi->ck->td; td->flag |= flag; const Type_Def tdef = new_type_def(gwi->gwion->mp, td, gwi->ck->sym); - gwi->ck->td = NULL; - if(td->types) + if(gwi->ck->tmpl) tdef->tmpl = new_tmpl(gwi->gwion->mp, gwi->ck->tmpl, -1); - tdef->tmpl = NULL; + gwi->ck->td = NULL; + gwi->ck->tmpl = NULL; const m_bool ret = traverse_type_def(gwi->gwion->env, tdef); const Type t = tdef->type; free_type_def(gwi->gwion->mp, tdef); diff --git a/tests/import/typedef_tmpl.c b/tests/import/typedef_tmpl.c index b3ec7251..d0201319 100644 --- a/tests/import/typedef_tmpl.c +++ b/tests/import/typedef_tmpl.c @@ -12,7 +12,7 @@ #include "import.h" GWION_IMPORT(typedef_test) { - GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef<~A~>")) + GWI_BB(gwi_typedef_ini(gwi, "Ptr<~A~>", "Typedef<~A~>")) GWI_BB(gwi_typedef_end(gwi, ae_flag_none)) return GW_OK; }