diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-03-01 17:59:56 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-03-01 17:59:56 -0700 |
| commit | f72c36cd37a383ca7ca9e09cb6a665dfe2c73365 (patch) | |
| tree | 3d00619cc5388f62dab00f0abbd2bf968fbb8b18 /test | |
| parent | 5df091fea98e91536f95e3b4bd5bcb0881f06989 (diff) | |
| download | zig-f72c36cd37a383ca7ca9e09cb6a665dfe2c73365.tar.gz zig-f72c36cd37a383ca7ca9e09cb6a665dfe2c73365.zip | |
fix detection of @import and @c_import inside fn body
Diffstat (limited to 'test')
| -rw-r--r-- | test/run_tests.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 34d4e46792..92622b7027 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1764,6 +1764,12 @@ fn f(n: Number) -> i32 { } } )SOURCE", 1, ".tmp_source.zig:9:5: error: enumeration value 'Four' not handled in switch"); + + add_compile_fail_case("import inside function body", R"SOURCE( +fn f() { + const std = @import("std"); +} + )SOURCE", 1, ".tmp_source.zig:3:17: error: @import invalid inside function bodies"); } ////////////////////////////////////////////////////////////////////////////// |
