diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-04-20 17:25:26 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-04-20 17:25:26 -0700 |
| commit | ae600d2f7f89989c297c036f189b7bedfde910af (patch) | |
| tree | e3440d87c859553fc3c3c60ed612cf5fa0f8af24 /test/run_tests.cpp | |
| parent | 6acc354957752e2cfa8d67bdd0e4c3b42f9be3c3 (diff) | |
| download | zig-ae600d2f7f89989c297c036f189b7bedfde910af.tar.gz zig-ae600d2f7f89989c297c036f189b7bedfde910af.zip | |
fix undeclared identifier not marking function as impure
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 6a3528e906..3e665dbef5 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1209,6 +1209,15 @@ const a = get_it(); #static_eval_enable(false) fn get_it() -> Foo { Foo {.x = 13} } )SOURCE", 1, ".tmp_source.zig:5:17: error: unable to evaluate constant expression"); + + add_compile_fail_case("undeclared identifier error should mark fn as impure", R"SOURCE( +fn foo() { + test_a_thing(); +} +fn test_a_thing() { + bad_fn_call(); +} + )SOURCE", 1, ".tmp_source.zig:6:5: error: use of undeclared identifier 'bad_fn_call'"); } ////////////////////////////////////////////////////////////////////////////// |
