hook up unions with lazy values

this case works now:

```zig
const Expr = union(enum) {
    Literal: u8,
    Question: *Expr,
};
```
This commit is contained in:
Andrew Kelley
2019-08-25 11:34:07 -04:00
parent d277a1196b
commit fa6c20a02d
3 changed files with 114 additions and 80 deletions

View File

@@ -6568,7 +6568,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val, const c
uint64_t pad_bytes = type_entry->data.unionation.union_abi_size - field_type_bytes;
LLVMValueRef correctly_typed_value = gen_const_val(g, payload_value, "");
make_unnamed_struct = is_llvm_value_unnamed_type(g, payload_value->type, correctly_typed_value) ||
payload_value->type != type_entry->data.unionation.most_aligned_union_member;
payload_value->type != type_entry->data.unionation.most_aligned_union_member->type_entry;
{
if (pad_bytes == 0) {