aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/for_unbounded.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-02-18 15:58:27 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-02-18 19:20:19 -0700
commit8b05205bb71fca55569a9ff4cab89ec9e09640ba (patch)
tree1bcc329a4a2d79b35f6ab5b6e8e6fcf8bc986f72 /test/cases/compile_errors/for_unbounded.zig
parente89bfedd8d68a731cb227327a325e16fc7812df9 (diff)
downloadzig-8b05205bb71fca55569a9ff4cab89ec9e09640ba.tar.gz
zig-8b05205bb71fca55569a9ff4cab89ec9e09640ba.zip
implement error for unbounded for loops
Diffstat (limited to 'test/cases/compile_errors/for_unbounded.zig')
-rw-r--r--test/cases/compile_errors/for_unbounded.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/cases/compile_errors/for_unbounded.zig b/test/cases/compile_errors/for_unbounded.zig
new file mode 100644
index 0000000000..5d05b1061f
--- /dev/null
+++ b/test/cases/compile_errors/for_unbounded.zig
@@ -0,0 +1,11 @@
+export fn b() void {
+ for (0..) |i| {
+ _ = i;
+ }
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :2:5: error: unbounded for loop