| ... | @@ -298,3 +298,17 @@ test "implicit cast zero sized array ptr to slice" { | ... | @@ -298,3 +298,17 @@ test "implicit cast zero sized array ptr to slice" { |
| 298 | const c: []const u8 = &b; | 298 | const c: []const u8 = &b; |
| 299 | expect(c.len == 0); | 299 | expect(c.len == 0); |
| 300 | } | 300 | } |
| | 301 | |
| | 302 | test "anonymous list literal syntax" { |
| | 303 | const S = struct { |
| | 304 | fn doTheTest() void { |
| | 305 | var array: [4]u8 = .{1, 2, 3, 4}; |
| | 306 | expect(array[0] == 1); |
| | 307 | expect(array[1] == 2); |
| | 308 | expect(array[2] == 3); |
| | 309 | expect(array[3] == 4); |
| | 310 | } |
| | 311 | }; |
| | 312 | S.doTheTest(); |
| | 313 | comptime S.doTheTest(); |
| | 314 | } |