diff options
| -rw-r--r-- | src/debug.c | 6 | ||||
| -rw-r--r-- | tests/alias.ek | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/debug.c b/src/debug.c index 2db23a9..e90f1ee 100644 --- a/src/debug.c +++ b/src/debug.c @@ -261,6 +261,9 @@ static void _type_str(FILE *fp, struct type *type) if (!type) return; + if (type->a) + fprintf(fp, "[%s = ", alias_id(type->a)); + switch (type->k) { case TYPE_VOID: { fprintf(fp, "void"); @@ -320,6 +323,9 @@ static void _type_str(FILE *fp, struct type *type) else fprintf(fp, "UNKNOWN TYPE"); } + + if (type->a) + fputc(']', fp); } char *type_str(struct type *t) diff --git a/tests/alias.ek b/tests/alias.ek new file mode 100644 index 0000000..c6a26d6 --- /dev/null +++ b/tests/alias.ek @@ -0,0 +1,9 @@ +typedef i27 {} +typedef i9 {} + +typedef int i27; + +main() +{ + int a = 10 as i9; +} |
