fix detection of @import and @c_import inside fn body

This commit is contained in:
Andrew Kelley
2016-03-01 17:59:56 -07:00
parent 5df091fea9
commit f72c36cd37
2 changed files with 10 additions and 4 deletions

View File

@@ -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");
}
//////////////////////////////////////////////////////////////////////////////