diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-05-30 15:35:30 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-05-30 15:46:11 -0400 |
| commit | 78f32259daa79aaced1c49bcdace936121a2ccc5 (patch) | |
| tree | dbb2441806129661ae061bd2ff825d7e84453152 /src/analyze.cpp | |
| parent | 7878f9660fcb8fa64fda0b2b67320fe9ddc2727b (diff) | |
| download | zig-78f32259daa79aaced1c49bcdace936121a2ccc5.tar.gz zig-78f32259daa79aaced1c49bcdace936121a2ccc5.zip | |
default struct field initialization expressions
closes #485
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 3769ae47c2..a62c24460e 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -965,9 +965,7 @@ ZigType *get_partial_container_type(CodeGen *g, Scope *scope, ContainerKind kind return entry; } -static ConstExprValue *analyze_const_value(CodeGen *g, Scope *scope, AstNode *node, ZigType *type_entry, - Buf *type_name) -{ +ConstExprValue *analyze_const_value(CodeGen *g, Scope *scope, AstNode *node, ZigType *type_entry, Buf *type_name) { size_t backward_branch_count = 0; size_t backward_branch_quota = default_backward_branch_quota; return ir_eval_const_value(g, scope, node, type_entry, @@ -2189,10 +2187,6 @@ static Error resolve_struct_zero_bits(CodeGen *g, ZigType *struct_type) { type_struct_field->src_index = i; type_struct_field->gen_index = SIZE_MAX; - if (field_node->data.struct_field.value != nullptr) { - add_node_error(g, field_node->data.struct_field.value, - buf_sprintf("enums, not structs, support field assignment")); - } if (field_type->id == ZigTypeIdOpaque) { add_node_error(g, field_node->data.struct_field.type, buf_sprintf("opaque types have unknown size and therefore cannot be directly embedded in structs")); |
