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.
This commit is contained in:
@@ -647,12 +647,12 @@ test "non-exhaustive enum" {
|
||||
else => true,
|
||||
});
|
||||
|
||||
try expect(@typeInfo(E).Enum.fields.len == 2);
|
||||
try expect(@typeInfo(E).@"enum".fields.len == 2);
|
||||
e = @as(E, @enumFromInt(12));
|
||||
try expect(@intFromEnum(e) == 12);
|
||||
e = @as(E, @enumFromInt(y));
|
||||
try expect(@intFromEnum(e) == 52);
|
||||
try expect(@typeInfo(E).Enum.is_exhaustive == false);
|
||||
try expect(@typeInfo(E).@"enum".is_exhaustive == false);
|
||||
}
|
||||
};
|
||||
try S.doTheTest(52);
|
||||
@@ -671,8 +671,8 @@ test "empty non-exhaustive enum" {
|
||||
});
|
||||
try expect(@intFromEnum(e) == y);
|
||||
|
||||
try expect(@typeInfo(E).Enum.fields.len == 0);
|
||||
try expect(@typeInfo(E).Enum.is_exhaustive == false);
|
||||
try expect(@typeInfo(E).@"enum".fields.len == 0);
|
||||
try expect(@typeInfo(E).@"enum".is_exhaustive == false);
|
||||
}
|
||||
};
|
||||
try S.doTheTest(42);
|
||||
@@ -708,8 +708,8 @@ test "single field non-exhaustive enum" {
|
||||
});
|
||||
|
||||
try expect(@intFromEnum(@as(E, @enumFromInt(y))) == y);
|
||||
try expect(@typeInfo(E).Enum.fields.len == 1);
|
||||
try expect(@typeInfo(E).Enum.is_exhaustive == false);
|
||||
try expect(@typeInfo(E).@"enum".fields.len == 1);
|
||||
try expect(@typeInfo(E).@"enum".is_exhaustive == false);
|
||||
}
|
||||
};
|
||||
try S.doTheTest(23);
|
||||
@@ -1253,9 +1253,9 @@ test "Non-exhaustive enum backed by comptime_int" {
|
||||
test "matching captures causes enum equivalence" {
|
||||
const S = struct {
|
||||
fn Nonexhaustive(comptime I: type) type {
|
||||
const UTag = @Type(.{ .Int = .{
|
||||
const UTag = @Type(.{ .int = .{
|
||||
.signedness = .unsigned,
|
||||
.bits = @typeInfo(I).Int.bits,
|
||||
.bits = @typeInfo(I).int.bits,
|
||||
} });
|
||||
return enum(UTag) { _ };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user