mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
Fix failing type reifications
This commit is contained in:
parent
c8fa767f08
commit
92458094c8
@ -1015,7 +1015,7 @@ fn CreateUniqueTuple(comptime N: comptime_int, comptime types: [N]type) type {
|
||||
@setEvalBranchQuota(10_000);
|
||||
var num_buf: [128]u8 = undefined;
|
||||
tuple_fields[i] = .{
|
||||
.name = std.fmt.bufPrint(&num_buf, "{d}", .{i}) catch unreachable,
|
||||
.name = std.fmt.bufPrintZ(&num_buf, "{d}", .{i}) catch unreachable,
|
||||
.type = T,
|
||||
.default_value = null,
|
||||
.is_comptime = false,
|
||||
|
||||
@ -549,7 +549,7 @@ test "Type.Fn" {
|
||||
|
||||
test "reified struct field name from optional payload" {
|
||||
comptime {
|
||||
const m_name: ?[1]u8 = "a".*;
|
||||
const m_name: ?[1:0]u8 = "a".*;
|
||||
if (m_name) |*name| {
|
||||
const T = @Type(.{ .Struct = .{
|
||||
.layout = .Auto,
|
||||
@ -711,7 +711,7 @@ test "struct field names sliced at comptime from larger string" {
|
||||
while (it.next()) |name| {
|
||||
fields = fields ++ &[_]Type.StructField{.{
|
||||
.alignment = 0,
|
||||
.name = name,
|
||||
.name = name ++ "",
|
||||
.type = usize,
|
||||
.default_value = null,
|
||||
.is_comptime = false,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user