From 26ea20d88fb1b201546e29058ac4aa5d4760a577 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 7 Feb 2016 15:11:20 -0700 Subject: implement @const_eval closes #73 --- test/run_tests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/run_tests.cpp') diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 4d9de75bfa..318ba36f94 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -2020,6 +2020,13 @@ fn func() -> bogus {} add_compile_fail_case("bogus compile var", R"SOURCE( const x = @compile_var("bogus"); )SOURCE", 1, ".tmp_source.zig:2:24: error: unrecognized compile variable: 'bogus'"); + + + add_compile_fail_case("@const_eval", R"SOURCE( +fn a(x: i32) { + const y = @const_eval(x); +} + )SOURCE", 1, ".tmp_source.zig:3:27: error: unable to evaluate constant expression"); } ////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3