aboutsummaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-08-09 22:26:09 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-08-09 22:26:09 +0300
commit0bee8234a52c9399544364e8d26b124cb487ce7c (patch)
treee026b5482d740473c50055f4424eb87b362ddddc /src/ast.c
parentaa7ea13840e68abff8e9cf74376a6276f6a99033 (diff)
downloadek-0bee8234a52c9399544364e8d26b124cb487ce7c.tar.gz
ek-0bee8234a52c9399544364e8d26b124cb487ce7c.zip
fix trait expansion
+ Accidentally referenced an owned string, add strdup() + Didn't replace type IDs in ->t2
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c13
1 files changed, 12 insertions, 1 deletions
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)