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 --- src/ast.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index 246cfef..6b3b28d 100644 --- a/src/ast.c +++ b/src/ast.c @@ -291,12 +291,17 @@ void ast_dump(int depth, struct ast *n) depth++; if (n->t) { - printf(" ("); type_dump_list(n->t); printf(")"); + printf(" ("); + type_dump_list(n->t); + printf(")"); } if (n->t2) type_dump_list(n->t2); + if (n->scope) + printf(" {%llu}", (unsigned long long)n->scope->number); + printf("\n"); if (n->s) @@ -354,6 +359,12 @@ void type_dump(struct type *n) DUMP(TYPE_CALLABLE); DUMP(TYPE_TRAIT); } + + if (n->t1) + type_dump_list(n->t1); + + if (n->t0) + type_dump_list(n->t0); } void type_dump_list(struct type *root) -- cgit v1.3