From b6d5a24ee7276571e64799e8dce1913d644ca23b Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 8 Oct 2019 16:28:13 +0200 Subject: [PATCH] :art: Testing --- src/lib/tuple.c | 4 +--- tests/internal_op/implicit_similar.gw | 2 ++ tests/tuple/cast_tuple.gw | 2 ++ tests/tuple/cast_tuple2.gw | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 tests/tuple/cast_tuple.gw create mode 100644 tests/tuple/cast_tuple2.gw diff --git a/src/lib/tuple.c b/src/lib/tuple.c index 0ef8172b..8af9b3d8 100644 --- a/src/lib/tuple.c +++ b/src/lib/tuple.c @@ -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)) diff --git a/tests/internal_op/implicit_similar.gw b/tests/internal_op/implicit_similar.gw index 1775c26b..01b26b75 100644 --- a/tests/internal_op/implicit_similar.gw +++ b/tests/internal_op/implicit_similar.gw @@ -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 index 00000000..d30202d2 --- /dev/null +++ b/tests/tuple/cast_tuple.gw @@ -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 index 00000000..050f959f --- /dev/null +++ b/tests/tuple/cast_tuple2.gw @@ -0,0 +1,3 @@ +class C { int i; } +C c; +c $ <~int~>Tuple; -- 2.43.0