Reject slices in use expressions

Co-Authored-By: emekoi <emekankurumeh@outlook.com>
This commit is contained in:
LemonBoy 2019-05-24 13:20:44 +02:00 committed by GitHub
parent f67ca20655
commit 86b3007b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3773,7 +3773,7 @@ static void add_symbols_from_struct(CodeGen *g, AstNode *src_use_node, AstNode *
ZigType *src_ty = use_expr->data.x_type;
assert(src_ty);
if (src_ty->id != ZigTypeIdStruct) {
if (src_ty->id != ZigTypeIdStruct || is_slice(src_ty)) {
add_node_error(g, dst_use_node,
buf_sprintf("expected struct, found '%s'", buf_ptr(&src_ty->name)));
decls_scope->any_imports_failed = true;