| ... | ... | @@ -1328,6 +1328,8 @@ fn structInitExpr( |
| 1328 | 1328 | } |
| 1329 | 1329 | switch (rl) { |
| 1330 | 1330 | .discard => { |
| 1331 | if (struct_init.ast.type_expr != 0) |
| 1332 | _ = try typeExpr(gz, scope, struct_init.ast.type_expr); |
| 1331 | 1333 | for (struct_init.ast.fields) |field_init| { |
| 1332 | 1334 | _ = try expr(gz, scope, .discard, field_init); |
| 1333 | 1335 | } |
| ... | ... | @@ -1412,6 +1414,9 @@ fn structInitExprRlPtr( |
| 1412 | 1414 | const field_ptr_list = try gpa.alloc(Zir.Inst.Index, struct_init.ast.fields.len); |
| 1413 | 1415 | defer gpa.free(field_ptr_list); |
| 1414 | 1416 | |
| 1417 | if (struct_init.ast.type_expr != 0) |
| 1418 | _ = try typeExpr(gz, scope, struct_init.ast.type_expr); |
| 1419 | |
| 1415 | 1420 | for (struct_init.ast.fields) |field_init, i| { |
| 1416 | 1421 | const name_token = tree.firstToken(field_init) - 2; |
| 1417 | 1422 | const str_index = try astgen.identAsString(name_token); |