authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-02-08 15:52:12+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2026-03-10 10:26:11+00:00
log1364cba90d41cb2f33380b23d534aaddbd6ceff2
tree616dbe8650002be58822d75c70c4d945e378d195
parentbe4c4ce2787537f860c8578eb9e497f66c2e9baf
signaturelock-open Commit is signed but in an unrecognized format.

behavior: update for type resolution changes


3 files changed, 1 insertions(+), 38 deletions(-)

test/behavior/array.zig-22
...@@ -539,28 +539,6 @@ test "sentinel element count towards the ABI size calculation" {...@@ -539,28 +539,6 @@ test "sentinel element count towards the ABI size calculation" {
539 try comptime S.doTheTest();539 try comptime S.doTheTest();
540}540}
541541
542test "zero-sized array with recursive type definition" {
543 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
544 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
545
546 const U = struct {
547 fn foo(comptime T: type, comptime n: usize) type {
548 return struct {
549 s: [n]T,
550 x: usize = n,
551 };
552 }
553 };
554
555 const S = struct {
556 list: U.foo(@This(), 0),
557 };
558
559 var t: S = .{ .list = .{ .s = undefined } };
560 _ = &t;
561 try expect(@as(usize, 0) == t.list.x);
562}
563
564test "type coercion of anon struct literal to array" {542test "type coercion of anon struct literal to array" {
565 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;543 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
566 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;544 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
test/behavior/sizeof_and_typeof.zig-15
...@@ -120,21 +120,6 @@ test "@bitOffsetOf" {...@@ -120,21 +120,6 @@ test "@bitOffsetOf" {
120 try expect(@offsetOf(A, "g") * 8 == @bitOffsetOf(A, "g"));120 try expect(@offsetOf(A, "g") * 8 == @bitOffsetOf(A, "g"));
121}121}
122122
123test "@sizeOf(T) == 0 doesn't force resolving struct size" {
124 const S = struct {
125 const Foo = struct {
126 y: if (@sizeOf(Foo) == 0) u64 else u32,
127 };
128 const Bar = struct {
129 x: i32,
130 y: if (0 == @sizeOf(Bar)) u64 else u32,
131 };
132 };
133
134 try expect(@sizeOf(S.Foo) == 4);
135 try expect(@sizeOf(S.Bar) == 8);
136}
137
138test "@TypeOf() has no runtime side effects" {123test "@TypeOf() has no runtime side effects" {
139 const S = struct {124 const S = struct {
140 fn foo(comptime T: type, ptr: *T) T {125 fn foo(comptime T: type, ptr: *T) T {
test/behavior/struct_contains_slice_of_itself.zig+1-1
...@@ -8,7 +8,7 @@ const Node = struct {...@@ -8,7 +8,7 @@ const Node = struct {
88
9const NodeAligned = struct {9const NodeAligned = struct {
10 payload: i32,10 payload: i32,
11 children: []align(@alignOf(NodeAligned)) NodeAligned,11 children: []align(1) NodeAligned,
12};12};
1313
14test "struct contains slice of itself" {14test "struct contains slice of itself" {