ERROR_BLOCK() any usages of "Did you mean?" like behaviour whilst iterating across a scope entry map

This commit is contained in:
gingerBill
2021-08-27 12:14:51 +01:00
parent bf56e3ea8d
commit b88e945268
4 changed files with 10 additions and 7 deletions
+4
View File
@@ -578,6 +578,8 @@ bool check_using_stmt_entity(CheckerContext *ctx, AstUsingStmt *us, Ast *expr, b
}
add_entity_use(ctx, expr, e);
ERROR_BLOCK();
switch (e->kind) {
case Entity_TypeName: {
@@ -2336,6 +2338,8 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
if (is_blank_ident(name)) {
error(token, "'using' cannot be applied variable declared as '_'");
} else if (is_type_struct(t) || is_type_raw_union(t)) {
ERROR_BLOCK();
Scope *scope = scope_of_node(t->Struct.node);
for_array(i, scope->elements.entries) {
Entity *f = scope->elements.entries[i].value;