diff options
| author | gingerBill <bill@gingerbill.org> | 2017-11-07 23:05:39 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2017-11-07 23:05:39 +0000 |
| commit | 30adb9c77001dd7a472212cb4b713dabd8a41564 (patch) | |
| tree | a34281abc89a4b8a779471d4d783f39fe8f23509 /src/check_stmt.cpp | |
| parent | b1d1497f4be15453a2ccecf44d45d03ad7718853 (diff) | |
Fix issue #134
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 11e0b8e52..ce406f9d5 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1830,7 +1830,9 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) { String name = e->token.string; Type *t = base_type(type_deref(e->type)); - if (is_type_struct(t) || is_type_raw_union(t)) { + 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)) { Scope *scope = scope_of_node(&c->info, t->Struct.node); for_array(i, scope->elements.entries) { Entity *f = scope->elements.entries[i].value; |