summaryrefslogtreecommitdiff
path: root/src/parser/parser_type.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/parser_type.c')
-rw-r--r--src/parser/parser_type.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser/parser_type.c b/src/parser/parser_type.c
index 1b5e8b6..27328fe 100644
--- a/src/parser/parser_type.c
+++ b/src/parser/parser_type.c
@@ -707,6 +707,13 @@ Type *parse_type_formal(ParserContext *ctx, Lexer *l)
expect(l, TOK_RBRACKET, "Expected ']' in array type");
+ if (size == 0)
+ {
+ char *inner_str = type_to_string(t);
+ register_slice(ctx, inner_str);
+ free(inner_str);
+ }
+
Type *arr = type_new(TYPE_ARRAY);
arr->inner = t;
arr->array_size = size;