diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-09-26 23:47:30 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-09-26 23:47:30 -0400 |
| commit | 183976b242dac0731caa7d925e88ad151a4dc8ee (patch) | |
| tree | 426fe019d53dd2c27695518fc64f5fddd449fef0 /test/run_tests.cpp | |
| parent | f4d7c91363c2525741522a7ad942a419653ae47b (diff) | |
| download | zig-183976b242dac0731caa7d925e88ad151a4dc8ee.tar.gz zig-183976b242dac0731caa7d925e88ad151a4dc8ee.zip | |
add this keyword refers to thing in immediate scope
See #169
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index aeab7566ab..4b03efc7d6 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1597,6 +1597,22 @@ const TINY_QUANTUM_SIZE = 1 << TINY_QUANTUM_SHIFT; var block_aligned_stuff: usize = (4 + TINY_QUANTUM_SIZE) & ~(TINY_QUANTUM_SIZE - 1); )SOURCE", 1, ".tmp_source.zig:4:60: error: unable to perform binary not operation on type '(integer literal)'"); + { + TestCase *tc = add_compile_fail_case("multiple files with private function error", R"SOURCE( +const foo = @import("foo.zig"); + +fn callPrivFunction() { + foo.privateFunction(); +} + )SOURCE", 2, + ".tmp_source.zig:5:8: error: 'privateFunction' is private", + "foo.zig:2:1: note: declared here"); + + add_source_file(tc, "foo.zig", R"SOURCE( +fn privateFunction() { } + )SOURCE"); + } + } ////////////////////////////////////////////////////////////////////////////// |
