setEvalBranchQuota must be called from top of comptime stack

This commit is contained in:
Andrew Kelley
2017-08-31 16:54:20 -04:00
parent 67b6dd28ec
commit c42e809f13
3 changed files with 19 additions and 3 deletions

View File

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