| ... | ... | @@ -459,10 +459,12 @@ const Parser = struct { |
| 459 | 459 | switch (@typeInfo(@TypeOf(out.*))) { |
| 460 | 460 | .optional => |optional| if (node.get(self.zoir) == .null) { |
| 461 | 461 | out.* = null; |
| 462 | } else if (initialized and out.* != null) { |
| 463 | try self.parseExprInnerInto(node, &out.*.?, true); |
| 462 | 464 | } else { |
| 463 | | const child_initialized = initialized and out.* != null; |
| 464 | | if (!child_initialized) out.* = @as(optional.child, undefined); |
| 465 | | try self.parseExprInnerInto(node, &out.*.?, child_initialized); |
| 465 | var some: optional.child = undefined; |
| 466 | try self.parseExprInnerInto(node, &some, false); |
| 467 | out.* = some; |
| 466 | 468 | }, |
| 467 | 469 | .bool => out.* = try self.parseBool(node), |
| 468 | 470 | .int => out.* = try self.parseInt(@TypeOf(out.*), node), |