aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-06-03 15:09:40 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-06-03 15:09:40 -0400
commite5b90651ba118cb0d3293c83bdfbc62c40f4c266 (patch)
tree35b7af7aeef87a6bbd8f621c0c4f763156945555 /test/compile_errors.zig
parente64f0971fc788cefb348e9516cd3b284df7ea0df (diff)
downloadzig-e5b90651ba118cb0d3293c83bdfbc62c40f4c266.tar.gz
zig-e5b90651ba118cb0d3293c83bdfbc62c40f4c266.zip
compileError builtin includes "referenced by" notes
to help track down the cause closes #278
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index d67f474fb7..fd07dbb2b1 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -1916,4 +1916,18 @@ pub fn addCases(cases: &tests.CompileErrorContext) {
\\}
,
".tmp_source.zig:7:9: error: calling a generic function requires compile-time known function value");
+
+ cases.add("@compileError shows traceback of references that caused it",
+ \\const foo = @compileError("aoeu");
+ \\
+ \\const bar = baz + foo;
+ \\const baz = 1;
+ \\
+ \\export fn entry() -> i32 {
+ \\ return bar;
+ \\}
+ ,
+ ".tmp_source.zig:1:13: error: aoeu",
+ ".tmp_source.zig:3:19: note: referenced here",
+ ".tmp_source.zig:7:12: note: referenced here");
}