diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-21 17:22:39 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-21 17:22:39 +0000 |
| commit | 5923e5f9560f3b60349965393cf81ba56c1c65ec (patch) | |
| tree | 651fc8e44c59da16da7cff5cfff7c4ebe7dc9f74 /src/parser/parser_expr.c | |
| parent | 9c3e1b3c55c677206e6f70919f81484a7f0fe0c5 (diff) | |
Fix for #76
Diffstat (limited to 'src/parser/parser_expr.c')
| -rw-r--r-- | src/parser/parser_expr.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/parser/parser_expr.c b/src/parser/parser_expr.c index 092b86b..2d0e10b 100644 --- a/src/parser/parser_expr.c +++ b/src/parser/parser_expr.c @@ -1384,6 +1384,21 @@ ASTNode *parse_primary(ParserContext *ctx, Lexer *l) char *tmp = xmalloc(strlen(acc) + suffix.len + 3); ASTNode *def = find_struct_def(ctx, acc); + + // If not found as a struct, check if it's an alias + if (!def) + { + const char *aliased = find_type_alias(ctx, acc); + if (aliased) + { + // Found an alias: replace acc with the aliased name + free(acc); + acc = xstrdup(aliased); + // Try finding the struct definition again with the resolved name + def = find_struct_def(ctx, acc); + } + } + if (def) { int is_variant = 0; |
