fix not resolving to alias in a recursive declaration

This commit is contained in:
Laytan
2025-04-16 22:55:25 +02:00
parent 3ba9b9b14e
commit 8efeaef40b

View File

@@ -468,6 +468,10 @@ gb_internal void check_type_decl(CheckerContext *ctx, Entity *e, Ast *init_expr,
}
e->type = named;
if (!is_distinct) {
e->TypeName.is_type_alias = true;
}
check_type_path_push(ctx, e);
Type *bt = check_type_expr(ctx, te, named);
check_type_path_pop(ctx);
@@ -502,9 +506,9 @@ gb_internal void check_type_decl(CheckerContext *ctx, Entity *e, Ast *init_expr,
if (!is_distinct) {
e->type = bt;
named->Named.base = bt;
e->TypeName.is_type_alias = true;
}
e->TypeName.is_type_alias = !is_distinct;
if (decl->type_expr != nullptr) {
Type *t = check_type(ctx, decl->type_expr);