mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 01:44:36 +00:00
fix load type panic because front-end allows a deref of a type
Fixes #5357
This commit is contained in:
@@ -11323,6 +11323,13 @@ gb_internal ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast
|
||||
node->viral_state_flags |= de->expr->viral_state_flags;
|
||||
|
||||
if (o->mode == Addressing_Invalid) {
|
||||
o->mode = Addressing_Invalid;
|
||||
o->expr = node;
|
||||
return kind;
|
||||
} else if (o->mode == Addressing_Type) {
|
||||
gbString str = expr_to_string(o->expr);
|
||||
error(o->expr, "Cannot dereference '%s' because it is a type", str);
|
||||
|
||||
o->mode = Addressing_Invalid;
|
||||
o->expr = node;
|
||||
return kind;
|
||||
|
||||
Reference in New Issue
Block a user