From e5b90651ba118cb0d3293c83bdfbc62c40f4c266 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 3 Jun 2017 15:09:40 -0400 Subject: compileError builtin includes "referenced by" notes to help track down the cause closes #278 --- test/compile_errors.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/compile_errors.zig') 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"); } -- cgit v1.2.3