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.
|
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); |
|
} |
|
} |
This issue can be closed when the CI additionally has behavior test coverage for stage3-release.
This was working a few weeks ago, so a
git bisectshould be able to find when this broke.zig/test/behavior/type.zig
Lines 512 to 542 in 50b36e8