authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-05-24 13:20:44+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2019-05-24 13:20:44+02:00
log86b3007b945d2145bc7467625c658fd5480b5135
tree47bf8f6acddcab32ea61f5808d0402af7fd109cf
parentf67ca206557de58df91011744f656ed049d36372
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Reject slices in use expressions

Co-Authored-By: emekoi <emekankurumeh@outlook.com>

1 files changed, 1 insertions(+), 1 deletions(-)

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