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