-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone
Description
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.
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
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.