| author | |
| committer | |
| log | e75598af3d011c6277d9d715f39d112db948d5e0 |
| tree | 58cd324bd8da12521d4cc31e59b6dd86ff9a8c12 |
| parent | dad62a7e27fb7e8ea1eb51d6619fd534106417f1 |
| signature |
Once this test case is passing, previous commit can be re-added.
Closes #45602 files changed, 33 insertions(+), 0 deletions(-)
test/stage1/behavior.zig+1| ... | ... | @@ -40,6 +40,7 @@ comptime { |
| 40 | 40 | _ = @import("behavior/bugs/3384.zig"); |
| 41 | 41 | _ = @import("behavior/bugs/3586.zig"); |
| 42 | 42 | _ = @import("behavior/bugs/3742.zig"); |
| 43 | _ = @import("behavior/bugs/4560.zig"); | |
| 43 | 44 | _ = @import("behavior/bugs/394.zig"); |
| 44 | 45 | _ = @import("behavior/bugs/421.zig"); |
| 45 | 46 | _ = @import("behavior/bugs/529.zig"); |
test/stage1/behavior/bugs/4560.zig created+32| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | const std = @import("std"); | |
| 2 | ||
| 3 | test "fixed" { | |
| 4 | var s: S = .{ | |
| 5 | .a = 1, | |
| 6 | .b = .{ | |
| 7 | .size = 123, | |
| 8 | .max_distance_from_start_index = 456, | |
| 9 | }, | |
| 10 | }; | |
| 11 | std.testing.expect(s.a == 1); | |
| 12 | std.testing.expect(s.b.size == 123); | |
| 13 | std.testing.expect(s.b.max_distance_from_start_index == 456); | |
| 14 | } | |
| 15 | ||
| 16 | const S = struct { | |
| 17 | a: u32, | |
| 18 | b: Map, | |
| 19 | ||
| 20 | const Map = std.StringHashMap(*S); | |
| 21 | }; | |
| 22 | ||
| 23 | pub fn StringHashMap(comptime V: type) type { | |
| 24 | return HashMap([]const u8, V); | |
| 25 | } | |
| 26 | ||
| 27 | pub fn HashMap(comptime K: type, comptime V: type) type { | |
| 28 | return struct { | |
| 29 | size: usize, | |
| 30 | max_distance_from_start_index: usize, | |
| 31 | }; | |
| 32 | } |