From 2d8691cfef92edf31da746668fd2da3c1fa5043c Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 12 Jan 2025 13:17:48 +0200 Subject: highlight flaws in current unification system --- tests/struct_priv_trait_cont/struct.ek | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/struct_priv_trait_cont/struct.ek (limited to 'tests/struct_priv_trait_cont/struct.ek') diff --git a/tests/struct_priv_trait_cont/struct.ek b/tests/struct_priv_trait_cont/struct.ek new file mode 100644 index 0000000..6c94aaa --- /dev/null +++ b/tests/struct_priv_trait_cont/struct.ek @@ -0,0 +1,32 @@ +pub typedef ptr {}; +pub typedef i27 {}; + +pub define trait[] { + do_something(=> i27); +} + +pub typedef implementer {} +continue implementer { + trait![]; + do_something(=> i27) + { + return 0; + } +} + +pub typedef struct[trait T] { + T a; + + call_something(*struct![T] self) + { + self*.a.do_something(); + } +} + +pub some_func() +{ + mut p = struct![implementer]{ + .a = implementer!{} + }; + p.call_something(); +} -- cgit v1.3