| ... | ... | @@ -2122,19 +2122,22 @@ pub const Value = extern union { |
| 2122 | 2122 | const b_union = b.castTag(.@"union").?.data; |
| 2123 | 2123 | switch (ty.containerLayout()) { |
| 2124 | 2124 | .Packed, .Extern => { |
| 2125 | | // In this case, we must disregard mismatching tags and compare |
| 2126 | | // based on the in-memory bytes of the payloads. |
| 2127 | | @panic("TODO implement comparison of extern union values"); |
| 2125 | const tag_ty = ty.unionTagTypeHypothetical(); |
| 2126 | if (!a_union.tag.eql(b_union.tag, tag_ty, target)) { |
| 2127 | // In this case, we must disregard mismatching tags and compare |
| 2128 | // based on the in-memory bytes of the payloads. |
| 2129 | @panic("TODO comptime comparison of extern union values with mismatching tags"); |
| 2130 | } |
| 2128 | 2131 | }, |
| 2129 | 2132 | .Auto => { |
| 2130 | 2133 | const tag_ty = ty.unionTagTypeHypothetical(); |
| 2131 | 2134 | if (!a_union.tag.eql(b_union.tag, tag_ty, target)) { |
| 2132 | 2135 | return false; |
| 2133 | 2136 | } |
| 2134 | | const active_field_ty = ty.unionFieldType(a_union.tag, target); |
| 2135 | | return a_union.val.eql(b_union.val, active_field_ty, target); |
| 2136 | 2137 | }, |
| 2137 | 2138 | } |
| 2139 | const active_field_ty = ty.unionFieldType(a_union.tag, target); |
| 2140 | return a_union.val.eql(b_union.val, active_field_ty, target); |
| 2138 | 2141 | }, |
| 2139 | 2142 | else => {}, |
| 2140 | 2143 | } else if (a_tag == .null_value or b_tag == .null_value) { |