]> Nishi Git Mirror - gwion.git/commitdiff
:art: Testing
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 8 Oct 2019 14:28:13 +0000 (16:28 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 8 Oct 2019 14:28:13 +0000 (16:28 +0200)
src/lib/tuple.c
tests/internal_op/implicit_similar.gw
tests/tuple/cast_tuple.gw [new file with mode: 0644]
tests/tuple/cast_tuple2.gw [new file with mode: 0644]

index 0ef8172b5368deb93395d273e47bca4af7a046d7..8af9b3d8d659027ee4fed7405cb5cdf06dc4f2a1 100644 (file)
@@ -199,7 +199,6 @@ static OP_EMIT(opem_at_tuple_object) {                    \
   return emit_add_instr(emit, ObjectAssign);              \
 }
 mk_opem_tuple2object(cast, Exp_Cast *, exp_self(exp)->type)
-mk_opem_tuple2object(impl, struct Implicit *, exp->t)
 
 static OP_CHECK(opck_cast_tuple) {
   const Exp_Cast *cast = (Exp_Cast*)data;
@@ -351,7 +350,7 @@ GWION_IMPORT(tuple) {
   GWI_BB(gwi_oper_emi(gwi, opem_at_tuple))
   GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign))
   GWI_BB(gwi_oper_add(gwi, opck_cast_tuple))
-  GWI_BB(gwi_oper_end(gwi, "$", NULL))
+  GWI_BB(gwi_oper_end(gwi, "$", NoOp))
   GWI_BB(gwi_oper_add(gwi, opck_impl_tuple))
   GWI_BB(gwi_oper_end(gwi, "@implicit", NULL))
   GWI_BB(gwi_oper_ini(gwi, "Tuple", "Object", NULL))
@@ -362,7 +361,6 @@ GWION_IMPORT(tuple) {
   GWI_BB(gwi_oper_emi(gwi, opem_cast_tuple_object))
   GWI_BB(gwi_oper_end(gwi, "$", NULL))
   GWI_BB(gwi_oper_add(gwi, opck_impl_tuple))
-  GWI_BB(gwi_oper_emi(gwi, opem_impl_tuple_object))
   GWI_BB(gwi_oper_end(gwi, "@implicit", NULL))
   GWI_BB(gwi_oper_ini(gwi, "Tuple", "Tuple", NULL))
   GWI_BB(gwi_oper_add(gwi, opck_at_tuple))
index 1775c26b18f5911fb50c575627096d08c0ed7866..01b26b75367c1ccf16cf53ba78ee6d01a9413f14 100644 (file)
@@ -1,3 +1,5 @@
 typedef int INT;
 fun void test(INT i) { <<< i >>>; }
+fun void test2(int i) { <<< i >>>; }
 1 => test;
+INT i => test2;
diff --git a/tests/tuple/cast_tuple.gw b/tests/tuple/cast_tuple.gw
new file mode 100644 (file)
index 0000000..d30202d
--- /dev/null
@@ -0,0 +1,2 @@
+Object o;
+o $ <~int~>Tuple;
diff --git a/tests/tuple/cast_tuple2.gw b/tests/tuple/cast_tuple2.gw
new file mode 100644 (file)
index 0000000..050f959
--- /dev/null
@@ -0,0 +1,3 @@
+class C { int i; }
+C c;
+c $ <~int~>Tuple;