From 9fb938244920b1a9d9a085ceaf651219baddc854 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Wed, 30 Apr 2025 19:39:38 +0200 Subject: fixes assigning null as a type if it's an alias but the base type isn't resolved yet It's a bit of a band aid fix because the field will get the type of the alias, not the base type, but that was already the case before #5045 so it's forward progression. Closes #5092 Fixes #5061 --- src/check_expr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/check_expr.cpp') diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 5185876e6..69f6bb855 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -1854,7 +1854,10 @@ gb_internal Entity *check_ident(CheckerContext *c, Operand *o, Ast *n, Type *nam o->type = t_invalid; } if (o->type != nullptr && o->type->kind == Type_Named && o->type->Named.type_name->TypeName.is_type_alias) { - o->type = base_type(o->type); + Type *bt = base_type(o->type); + if (bt != nullptr) { + o->type = bt; + } } break; -- cgit v1.2.3