better handling of lazy structs

this case works now:

```zig
const A = struct {
    b_list_pointer: *const []B,
};
const B = struct {
    a_pointer: *const A,
};

const b_list: []B = [_]B{};
const a = A{ .b_list_pointer = &b_list };
const obj = B{ .a_pointer = &a };
```
This commit is contained in:
Andrew Kelley
2019-08-23 15:54:51 -04:00
parent be0a9a7277
commit ac4dd9d665
5 changed files with 44 additions and 42 deletions

View File

@@ -3688,7 +3688,7 @@ static void render_async_spills(CodeGen *g) {
}
if (ir_get_var_is_comptime(var))
continue;
switch (type_requires_comptime(g, var->var_type, nullptr)) {
switch (type_requires_comptime(g, var->var_type)) {
case ReqCompTimeInvalid:
zig_unreachable();
case ReqCompTimeYes:
@@ -7049,7 +7049,7 @@ static void do_code_gen(CodeGen *g) {
}
if (ir_get_var_is_comptime(var))
continue;
switch (type_requires_comptime(g, var->var_type, nullptr)) {
switch (type_requires_comptime(g, var->var_type)) {
case ReqCompTimeInvalid:
zig_unreachable();
case ReqCompTimeYes: