From c42e809f132d91fca1f96da2ecff7d78e1085c3f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 31 Aug 2017 16:54:20 -0400 Subject: setEvalBranchQuota must be called from top of comptime stack --- test/compile_errors.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/compile_errors.zig') diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 81d1361aec..2ab26c0078 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2068,4 +2068,15 @@ pub fn addCases(cases: &tests.CompileErrorContext) { , ".tmp_source.zig:2:24: error: expected [2]u8 literal, found [3]u8 literal"); + cases.add("@setEvalBranchQuota in non-root comptime execution context", + \\comptime { + \\ foo(); + \\} + \\fn foo() { + \\ @setEvalBranchQuota(1001); + \\} + , + ".tmp_source.zig:5:5: error: @setEvalBranchQuota must be called from the top of the comptime stack", + ".tmp_source.zig:2:8: note: called from here", + ".tmp_source.zig:1:10: note: called from here"); } -- cgit v1.2.3