Browse Source

Fix error reporting for type cycles

gingerBill 1 year ago
parent
commit
50618759a6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/check_expr.cpp

+ 1 - 1
src/check_expr.cpp

@@ -1738,7 +1738,7 @@ gb_internal Entity *check_ident(CheckerContext *c, Operand *o, Ast *n, Type *nam
 		if (check_cycle(c, e, true)) {
 		if (check_cycle(c, e, true)) {
 			o->type = t_invalid;
 			o->type = t_invalid;
 		}
 		}
-		if (o->type != nullptr && type->kind == Type_Named && o->type->Named.type_name->TypeName.is_type_alias) {
+		if (o->type != nullptr && o->type->kind == Type_Named && o->type->Named.type_name->TypeName.is_type_alias) {
 			o->type = base_type(o->type);
 			o->type = base_type(o->type);
 		}
 		}