From 0bee8234a52c9399544364e8d26b124cb487ce7c Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 9 Aug 2024 22:26:09 +0300 Subject: fix trait expansion + Accidentally referenced an owned string, add strdup() + Didn't replace type IDs in ->t2 --- tests/generic.ek | 7 +++++++ tests/trait_expand.ek | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/generic.ek (limited to 'tests') diff --git a/tests/generic.ek b/tests/generic.ek new file mode 100644 index 0000000..7e17d97 --- /dev/null +++ b/tests/generic.ek @@ -0,0 +1,7 @@ +typedef i27 {} +typedef a[any T] {} + +main() +{ + a![i27] a; +} diff --git a/tests/trait_expand.ek b/tests/trait_expand.ek index eca1e16..2d9f90d 100644 --- a/tests/trait_expand.ek +++ b/tests/trait_expand.ek @@ -5,3 +5,15 @@ define b[] { define a[] { a(*a a); } + +typedef c { + b![]; + + a(*c) {} +} + +main() +{ + c c; + c.a(); +} -- cgit v1.3