aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/array_access_of_non_array.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/cases/compile_errors/array_access_of_non_array.zig')
-rw-r--r--test/cases/compile_errors/array_access_of_non_array.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/cases/compile_errors/array_access_of_non_array.zig b/test/cases/compile_errors/array_access_of_non_array.zig
new file mode 100644
index 0000000000..06fa1569e6
--- /dev/null
+++ b/test/cases/compile_errors/array_access_of_non_array.zig
@@ -0,0 +1,15 @@
+export fn f() void {
+ var bad : bool = undefined;
+ bad[0] = bad[0];
+}
+export fn g() void {
+ var bad : bool = undefined;
+ _ = bad[0];
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :3:8: error: element access of non-indexable type 'bool'
+// :7:12: error: element access of non-indexable type 'bool'