]> Nishi Git Mirror - gwion.git/commitdiff
:art: More tests
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 14 Jul 2019 17:20:52 +0000 (19:20 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 14 Jul 2019 17:20:52 +0000 (19:20 +0200)
src/lib/engine.c
src/parse/template.c
tests/new/parent.gw [new file with mode: 0644]
tests/new/typedef_func_tmpl_err.gw [new file with mode: 0644]
tests/new/typedef_func_tmpl_tmpl.gw [new file with mode: 0644]
tests/sh/opt.sh

index 05bda69ec62af8c9f87779a5f24d5a403dbf3a97..a3f498ad1daf64d4040e87027e2e74e34a920f5c 100644 (file)
@@ -100,7 +100,7 @@ ANN m_bool type_engine_init(VM* vm, const Vector plug_dirs) {
   memset(&gwi, 0, sizeof(struct Gwi_));
   gwi.gwion = vm->gwion;
   gwi.loc = new_loc(vm->gwion->mp, 0);
-  CHECK_BB(import_core_libs(&gwi))
+  GWI_BB(import_core_libs(&gwi))
   vm->gwion->env->name = "[imported]";
   for(m_uint i = 0; i < vector_size(plug_dirs); ++i) {
     m_bool (*import)(Gwi) = (m_bool(*)(Gwi))vector_at(plug_dirs, i);
index 0e02fb1d2a29cd34bd3e49fba79bd100d5e7e261..f0a07c4e02ef784ed9dafb0d609a7da04bda905f 100644 (file)
@@ -187,11 +187,6 @@ ANN Type scan_type(const Env env, const Type t, const Type_Decl* type) {
     if(GET_FLAG(t, builtin))
       SET_FLAG(a->base.type, builtin);
     CHECK_BO(scan1_cdef(env, a))
-    if(t->nspc->dtor) {
-      a->base.type->nspc->dtor = t->nspc->dtor;
-      SET_FLAG(a->base.type, dtor);
-      ADD_REF(t->nspc->dtor)
-    }
     return a->base.type;
   } else if(type->types) { // TODO: clean me
     if(isa(t, t_function) > 0 && t->e->d.func->def->base->tmpl) {
diff --git a/tests/new/parent.gw b/tests/new/parent.gw
new file mode 100644 (file)
index 0000000..f330a5c
--- /dev/null
@@ -0,0 +1,14 @@
+class B {
+
+}
+class <~A~> C extends B {
+
+}
+class <~A,B~> D extends <~A~>C {
+  class <~A~>Child {
+    A a;
+  }
+  <~A~>Child child;
+}
+
+<~int~>D d;
diff --git a/tests/new/typedef_func_tmpl_err.gw b/tests/new/typedef_func_tmpl_err.gw
new file mode 100644 (file)
index 0000000..5088d90
--- /dev/null
@@ -0,0 +1,16 @@
+typedef void t_ptr<~A~>();
+
+t_ptr ptr;
+
+fun void test<~A~>() {
+  <<< __func_ >>>;
+}
+
+test @=> ptr;
+ptr<~int~>();
+
+
+#!typedef <~int~>t_ptr B;
+#!B B;
+#!<<<b>>>;
+#!<<< B<~int~>() >>>;
diff --git a/tests/new/typedef_func_tmpl_tmpl.gw b/tests/new/typedef_func_tmpl_tmpl.gw
new file mode 100644 (file)
index 0000000..04a943b
--- /dev/null
@@ -0,0 +1,2 @@
+typedef void ptr_t<~A~>(myPtr ptr);
+<~ <~A~> Ptr~>ptr_t t;
index 8234e3d1606a035fea3733fefea214730d206402..9b733534f7f0af6027c8dc7f8442c9ce8aa4498a 100644 (file)
@@ -58,7 +58,7 @@ run "$n" "loop" "-l0" "file"
 
 # memoization
 n=$((n+1))
-run "$n" "memoize" "-z2 tests/new/pure.gw" "file"
+run "$n" "memoize" "-z2 tests/new/pure*.gw" "file"
 
 # (fake) module arg
 n=$((n+1))