| ... | ... | @@ -1601,7 +1601,42 @@ fn walkInstruction( |
| 1601 | 1601 | .expr = .{ .builtinIndex = bin_index }, |
| 1602 | 1602 | }; |
| 1603 | 1603 | }, |
| 1604 | .truncate => { |
| 1605 | // in the ZIR this node is a builtin `bin` but we want send it as a `un` builtin |
| 1606 | const pl_node = data[inst_index].pl_node; |
| 1607 | const extra = file.zir.extraData(Zir.Inst.Bin, pl_node.payload_index); |
| 1604 | 1608 | |
| 1609 | var rhs: DocData.WalkResult = try self.walkRef( |
| 1610 | file, |
| 1611 | parent_scope, |
| 1612 | parent_src, |
| 1613 | extra.data.rhs, |
| 1614 | false, |
| 1615 | ); |
| 1616 | |
| 1617 | const bin_index = self.exprs.items.len; |
| 1618 | try self.exprs.append(self.arena, .{ .builtin = .{ .param = 0 } }); |
| 1619 | |
| 1620 | const rhs_index = self.exprs.items.len; |
| 1621 | try self.exprs.append(self.arena, rhs.expr); |
| 1622 | |
| 1623 | var lhs: DocData.WalkResult = try self.walkRef( |
| 1624 | file, |
| 1625 | parent_scope, |
| 1626 | parent_src, |
| 1627 | extra.data.lhs, |
| 1628 | false, |
| 1629 | ); |
| 1630 | |
| 1631 | self.exprs.items[bin_index] = .{ .builtin = .{ .name = @tagName(tags[inst_index]), .param = rhs_index } }; |
| 1632 | |
| 1633 | std.debug.print("lhs: {any}\n\n", .{lhs}); |
| 1634 | std.debug.print("lhs typeref: {any}\n\n", .{lhs.typeRef}); |
| 1635 | return DocData.WalkResult{ |
| 1636 | .typeRef = lhs.expr, |
| 1637 | .expr = .{ .builtinIndex = bin_index }, |
| 1638 | }; |
| 1639 | }, |
| 1605 | 1640 | .int_from_float, |
| 1606 | 1641 | .float_from_int, |
| 1607 | 1642 | .ptr_from_int, |
| ... | ... | @@ -1609,7 +1644,6 @@ fn walkInstruction( |
| 1609 | 1644 | .float_cast, |
| 1610 | 1645 | .int_cast, |
| 1611 | 1646 | .ptr_cast, |
| 1612 | | .truncate, |
| 1613 | 1647 | .has_decl, |
| 1614 | 1648 | .has_field, |
| 1615 | 1649 | .div_exact, |