From 7eaa051d4dcc3048c46f302997fd2175a983ac0e Mon Sep 17 00:00:00 2001 From: Kimplul Date: Wed, 15 Jan 2025 19:14:58 +0200 Subject: improve generics expansion --- tests/callbacks/callbacks.ek | 5 +++-- tests/struct_func_ptr/source.mk | 1 + tests/struct_func_ptr/struct_func_ptr.ek | 14 ++++++++++++++ tests/struct_priv_trait_cont/source.mk | 2 +- tests/trait_multiple_expand/source.mk | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 tests/struct_func_ptr/source.mk create mode 100644 tests/struct_func_ptr/struct_func_ptr.ek (limited to 'tests') diff --git a/tests/callbacks/callbacks.ek b/tests/callbacks/callbacks.ek index 927c122..9e16627 100644 --- a/tests/callbacks/callbacks.ek +++ b/tests/callbacks/callbacks.ek @@ -1,6 +1,7 @@ typedef i27 {} +typedef ptr {} -do_stuff(^(i27 => i27) proc => i27) +do_stuff(*(i27 => i27) proc => i27) { return proc(20); } @@ -12,5 +13,5 @@ other_proc(i27 a => i27) main() { - do_stuff(other_proc); + do_stuff(other_proc&); } diff --git a/tests/struct_func_ptr/source.mk b/tests/struct_func_ptr/source.mk new file mode 100644 index 0000000..96deda8 --- /dev/null +++ b/tests/struct_func_ptr/source.mk @@ -0,0 +1 @@ +SIMPLE += struct_func_ptr diff --git a/tests/struct_func_ptr/struct_func_ptr.ek b/tests/struct_func_ptr/struct_func_ptr.ek new file mode 100644 index 0000000..43da6cc --- /dev/null +++ b/tests/struct_func_ptr/struct_func_ptr.ek @@ -0,0 +1,14 @@ +typedef ptr {} +typedef i27 {} + +typedef struct { + *() f; +} + +do_something(){} + +main() +{ + mut p = struct!{.f = do_something&}; + p.f(); +} diff --git a/tests/struct_priv_trait_cont/source.mk b/tests/struct_priv_trait_cont/source.mk index cff75f9..5bd36f0 100644 --- a/tests/struct_priv_trait_cont/source.mk +++ b/tests/struct_priv_trait_cont/source.mk @@ -1 +1 @@ -SIMPLE_XFAIL += struct_priv_trait_cont +SIMPLE += struct_priv_trait_cont diff --git a/tests/trait_multiple_expand/source.mk b/tests/trait_multiple_expand/source.mk index f4e9516..6d1bcbb 100644 --- a/tests/trait_multiple_expand/source.mk +++ b/tests/trait_multiple_expand/source.mk @@ -1 +1 @@ -SIMPLE += trait_multiple_expand +SIMPLE_XFAIL += trait_multiple_expand -- cgit v1.3