-
-
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
Zig Version
0.11.0-dev.3268+9d4d96ca9
Steps to Reproduce and Observed Behavior
Run zig test on the following file
const std = @import("std");
const Arr: [3]type = .{ i32, i32, i32 };
const T: type = std.meta.Tuple(Arr[0..2]);
test "simple test" {
var foo: T = .{ 0, 0 };
_ = foo;
}Output:
❯ zig build test
zig test Debug native: error: the following command failed with 1 compilation errors:
/home/user/.local/share/zig/0.11.0-dev.3268+9d4d96ca9/files/zig test /home/user/computing/debug/zig-meta-tuple/src/main.zig --cache-dir /home/user/computing/debug/zig-meta-tuple/zig-cache --global-cache-dir /home/user/.cache/zig --name test --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with -fno-summary)
test transitive failure
└─ run test transitive failure
└─ zig test Debug native 1 errors
/home/user/.local/share/zig/0.11.0-dev.3268+9d4d96ca9/files/lib/std/meta.zig:1060:60: error: comptime dereference requires '[2]type' to have a well-defined layout, but it does not.
return CreateUniqueTuple(types.len, types[0..types.len].*);
~~~~~~~~~~~~~~~~~~~^~
src/main.zig:4:31: note: called from here
const T: type = std.meta.Tuple(Arr[0..2]);
~~~~~~~~~~~~~~^~~~~~~~~~~
Expected Behavior
Test should pass
Reactions are currently unavailable
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.