From 06c4b35eb12a54a4e260a80ed8ed21eb5bfae09a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 26 Jul 2016 23:51:58 -0700 Subject: std: improve rand implementation and API --- test/run_tests.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/run_tests.cpp') diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 7d5948628e..1cb7fddc3b 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1427,6 +1427,12 @@ export inline fn foo(x: i32, y: i32) -> i32{ )SOURCE", 1, ".tmp_source.zig:2:1: error: extern functions cannot be inline"); */ + add_compile_fail_case("convert fixed size array to slice with invalid size", R"SOURCE( +fn f() { + var array: [5]u8 = undefined; + var foo = ([]u32)(array)[0]; +} + )SOURCE", 1, ".tmp_source.zig:4:22: error: unable to convert [5]u8 to []u32: size mismatch"); } ////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3