aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-15 19:05:51 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-15 19:05:51 -0700
commit8bc3fae1cf055e33e01e0cbbbbc67f307f60b95b (patch)
tree1fc0b4b9b4955d94e96e5bccef733afe2ec25a9f /src
parent8818c59cbc96e6b0699a408d2fbaa9846356d85a (diff)
downloadzig-8bc3fae1cf055e33e01e0cbbbbc67f307f60b95b.tar.gz
zig-8bc3fae1cf055e33e01e0cbbbbc67f307f60b95b.zip
fix error message for struct initialization on array
Diffstat (limited to 'src')
-rw-r--r--src/analyze.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 513ec1cc6c..9fa5409c1e 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -1342,6 +1342,7 @@ static TypeTableEntry *analyze_container_init_expr(CodeGen *g, ImportTableEntry
if (container_type->id == TypeTableEntryIdInvalid) {
return container_type;
} else if (container_type->id == TypeTableEntryIdStruct &&
+ !container_type->data.structure.is_unknown_size_array &&
kind == ContainerInitKindStruct)
{
StructValExprCodeGen *codegen = &container_init_expr->resolved_struct_val_expr;
@@ -1410,7 +1411,7 @@ static TypeTableEntry *analyze_container_init_expr(CodeGen *g, ImportTableEntry
}
} else {
add_node_error(g, node,
- buf_sprintf("type '%s' does not support %s syntax",
+ buf_sprintf("type '%s' does not support %s initialization syntax",
buf_ptr(&container_type->name), err_container_init_syntax_name(kind)));
return g->builtin_types.entry_invalid;
}