zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit cbf2b1fea43c53cb33a362b277fe688f06744bf1 (tree)
parent dd189a354bf1c77b1996725902c7f29526cc22a4
Author: Meghan Denny <hello@nektro.net>
Date:   Wed, 20 Dec 2023 16:49:05 -0800

test: add coverage for index into comptime-known vector is comptime-known
Diffstat:
Mtest/behavior/vector.zig | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/test/behavior/vector.zig b/test/behavior/vector.zig @@ -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"); +}