aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/union.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-28 02:35:53 +0100
committermlugg <mlugg@mlugg.co.uk>2024-08-28 08:39:59 +0100
commit0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9 (patch)
tree2c07fddf2b6230360fe618c4de192bc2d24eeaf7 /test/behavior/union.zig
parent1a178d499537b922ff05c5d0186ed5a00dbb1a9b (diff)
downloadzig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.tar.gz
zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.zip
std: update `std.builtin.Type` fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
Diffstat (limited to 'test/behavior/union.zig')
-rw-r--r--test/behavior/union.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/behavior/union.zig b/test/behavior/union.zig
index 56ea22f3cc..13d8862dea 100644
--- a/test/behavior/union.zig
+++ b/test/behavior/union.zig
@@ -479,7 +479,7 @@ test "global union with single field is correctly initialized" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
glbl = Foo1{
- .f = @typeInfo(Foo1).Union.fields[0].type{ .x = 123 },
+ .f = @typeInfo(Foo1).@"union".fields[0].type{ .x = 123 },
};
try expect(glbl.f.x == 123);
}
@@ -600,8 +600,8 @@ test "tagged union type" {
const baz = Baz.B;
try expect(baz == Baz.B);
- try expect(@typeInfo(TaggedFoo).Union.fields.len == 3);
- try expect(@typeInfo(Baz).Enum.fields.len == 4);
+ try expect(@typeInfo(TaggedFoo).@"union".fields.len == 3);
+ try expect(@typeInfo(Baz).@"enum".fields.len == 4);
try expect(@sizeOf(TaggedFoo) == @sizeOf(FooNoVoid));
try expect(@sizeOf(Baz) == 1);
}
@@ -2305,13 +2305,13 @@ test "create union(enum) from other union(enum)" {
test "matching captures causes union equivalence" {
const S = struct {
fn SignedUnsigned(comptime I: type) type {
- const bits = @typeInfo(I).Int.bits;
+ const bits = @typeInfo(I).int.bits;
return union {
- u: @Type(.{ .Int = .{
+ u: @Type(.{ .int = .{
.signedness = .unsigned,
.bits = bits,
} }),
- i: @Type(.{ .Int = .{
+ i: @Type(.{ .int = .{
.signedness = .signed,
.bits = bits,
} }),