mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
test: add coverage for index into comptime-known vector is comptime-known
This commit is contained in:
parent
dd189a354b
commit
cbf2b1fea4
@ -1525,3 +1525,8 @@ test "bitcast to vector with different child type" {
|
||||
try S.doTheTest();
|
||||
try comptime S.doTheTest();
|
||||
}
|
||||
|
||||
test "index into comptime-known vector is comptime-known" {
|
||||
const vec: @Vector(2, f16) = [2]f16{ 1.5, 3.5 };
|
||||
if (vec[0] != 1.5) @compileError("vec should be comptime");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user