From 5923e5f9560f3b60349965393cf81ba56c1c65ec Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Wed, 21 Jan 2026 17:22:39 +0000 Subject: Fix for #76 --- src/parser/parser_expr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/parser/parser_expr.c') 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; -- cgit v1.2.3