| ... | ... | @@ -932,6 +932,19 @@ test "expectEqualDeep composite type" { |
| 932 | 932 | try expectEqualDeep(a, b); |
| 933 | 933 | try expectEqualDeep(&a, &b); |
| 934 | 934 | } |
| 935 | |
| 936 | // inferred union |
| 937 | const TestStruct2 = struct { |
| 938 | const A = union(enum) { b: B, c: C }; |
| 939 | const B = struct {}; |
| 940 | const C = struct { a: *const A }; |
| 941 | }; |
| 942 | |
| 943 | const union1 = TestStruct2.A{ .b = .{} }; |
| 944 | try expectEqualDeep( |
| 945 | TestStruct2.A{ .c = .{ .a = &union1 } }, |
| 946 | TestStruct2.A{ .c = .{ .a = &union1 } }, |
| 947 | ); |
| 935 | 948 | } |
| 936 | 949 | |
| 937 | 950 | fn printIndicatorLine(source: []const u8, indicator_index: usize) void { |