Skip to content

stage3-release does not pass the new reify fn test case #12360

@andrewrk

Description

@andrewrk

This issue can be closed when the CI additionally has behavior test coverage for stage3-release.

$ stage3-release/bin/zig test ../test/behavior.zig -I../test
Test [1144/1343] test.Type.Fn... expected type fn(c_int, *behavior.type.test.Type.Fn.some_opaque) callconv(.C) void, found type fn(c_int, *behavior.type.test.Type.Fn.some_opaque) callconv(.C) void
Test [1144/1343] test.Type.Fn... FAIL (TestExpectedEqual)
1252 passed; 90 skipped; 1 failed.

This was working a few weeks ago, so a git bisect should be able to find when this broke.

zig/test/behavior/type.zig

Lines 512 to 542 in 50b36e8

test "Type.Fn" {
if (builtin.zig_backend == .stage1) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
const some_opaque = opaque {};
const some_ptr = *some_opaque;
const T = fn (c_int, some_ptr) callconv(.C) void;
{
const fn_info = std.builtin.Type{ .Fn = .{
.calling_convention = .C,
.alignment = 0,
.is_generic = false,
.is_var_args = false,
.return_type = void,
.args = &.{
.{ .is_generic = false, .is_noalias = false, .arg_type = c_int },
.{ .is_generic = false, .is_noalias = false, .arg_type = some_ptr },
},
} };
const fn_type = @Type(fn_info);
try std.testing.expectEqual(T, fn_type);
}
{
const fn_info = @typeInfo(T);
const fn_type = @Type(fn_info);
try std.testing.expectEqual(T, fn_type);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions