add missing compile error for comptime continue inside runtime catch
See #2604
This commit is contained in:
@@ -1148,6 +1148,22 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
|
||||
"tmp.zig:4:5: error: no-inline call of inline function",
|
||||
);
|
||||
|
||||
cases.add(
|
||||
"comptime continue inside runtime catch",
|
||||
\\export fn entry(c: bool) void {
|
||||
\\ const ints = [_]u8{ 1, 2 };
|
||||
\\ inline for (ints) |_| {
|
||||
\\ bad() catch |_| continue;
|
||||
\\ }
|
||||
\\}
|
||||
\\fn bad() !void {
|
||||
\\ return error.Bad;
|
||||
\\}
|
||||
,
|
||||
"tmp.zig:4:25: error: comptime control flow inside runtime block",
|
||||
"tmp.zig:4:15: note: runtime block created here",
|
||||
);
|
||||
|
||||
cases.add(
|
||||
"comptime continue inside runtime switch",
|
||||
\\export fn entry() void {
|
||||
|
||||
Reference in New Issue
Block a user