Restrict global variables to not allow tuples

This commit is contained in:
Ginger Bill
2017-08-20 19:35:52 +01:00
parent f30d2e43ea
commit e5502c13ee
3 changed files with 19 additions and 17 deletions

View File

@@ -825,7 +825,7 @@ void check_struct_field_decl(Checker *c, AstNode *decl, Array<Entity *> *fields,
is_using = false;
}
bool arity_ok = check_arity_match(c, vd);
bool arity_ok = check_arity_match(c, vd, false);
if (vd->values.count > 0 && !allow_default_values) {
error(vd->values[0], "Default values are not allowed within a %.*s", LIT(context));
@@ -5996,7 +5996,7 @@ void check_unpack_arguments(Checker *c, Entity **lhs, isize lhs_count, Array<Ope
Operand o = {};
if (lhs != nullptr && tuple_index < lhs_count) {
// NOTE(bill): override DeclInfo for dependency control
// NOTE(bill): override DeclInfo for dependency
DeclInfo *decl = decl_info_of_entity(&c->info, lhs[tuple_index]);
if (decl) c->context.decl = decl;
}