Improve error messages with 'using _'

This commit is contained in:
Lucas Perlind
2022-10-14 18:22:59 +11:00
parent 874c1f076d
commit 73c1f08776
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -1488,6 +1488,11 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
if (!(e->flags & EntityFlag_Using)) {
continue;
}
if (is_blank_ident(e->token)) {
error(e->token, "'using' a procedure parameter requires a non blank identifier");
break;
}
bool is_value = (e->flags & EntityFlag_Value) != 0 && !is_type_pointer(e->type);
String name = e->token.string;
Type *t = base_type(type_deref(e->type));