aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-07-15 11:38:16 +0300
committerVeikka Tuominen <git@vexu.eu>2022-07-15 15:11:43 +0300
commit1463144fc88550ba1dca3888acdcdd4903781222 (patch)
tree19aa9a5f957b04d095afc7d6009eaf26877d19a4 /test/compile_errors.zig
parentb5a838247bd7d66037ba48378c34ba4460747deb (diff)
downloadzig-1463144fc88550ba1dca3888acdcdd4903781222.tar.gz
zig-1463144fc88550ba1dca3888acdcdd4903781222.zip
Compilation: point caret in error message at the main token
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 1337917323..fe6145cc12 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -174,6 +174,15 @@ pub fn addCases(ctx: *TestContext) !void {
});
}
+ {
+ const case = ctx.obj("missing semicolon at EOF", .{});
+ case.addError(
+ \\const foo = 1
+ , &[_][]const u8{
+ \\:1:14: error: expected ';' after declaration
+ });
+ }
+
// TODO test this in stage2, but we won't even try in stage1
//ctx.objErrStage1("inline fn calls itself indirectly",
// \\export fn foo() void {