mirror of
https://github.com/odin-lang/Odin.git
synced 2026-09-03 10:40:20 +00:00
Merge pull request #7500 from mocompute/chained-offset-of-disallow
Detect and error on chained offset_of expressions.
This commit is contained in:
@@ -3146,6 +3146,13 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
||||
}
|
||||
|
||||
ast_node(se, SelectorExpr, arg0);
|
||||
if (unparen_expr(se->expr)->kind == Ast_SelectorExpr) {
|
||||
gbString x = expr_to_string(arg0);
|
||||
error(ce->args[0], "Chained expressions are not allowed for '%.*s', got '%s' ", LIT(builtin_name), x);
|
||||
gb_string_free(x);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
Operand x = {};
|
||||
check_expr(c, &x, se->expr);
|
||||
|
||||
Reference in New Issue
Block a user