aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-03-03 12:13:13 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-03-08 18:52:44 -0400
commite2fd289a33bb35cf4b86daa4d80adb7cc0c2c2b0 (patch)
treeabb7d449b2d8e6d505e4ef4598793e3bbe711b16 /test/compile_errors.zig
parent06d0dac0fb58c2d20036e34f5c1a1bc9c386c189 (diff)
downloadzig-e2fd289a33bb35cf4b86daa4d80adb7cc0c2c2b0.tar.gz
zig-e2fd289a33bb35cf4b86daa4d80adb7cc0c2c2b0.zip
ir: Create usize result_loc for array subscript expr
Allow the subscript expression to infer the resulting type. Closes #4169
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 2b74d8fc77..717793baaa 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -3610,11 +3610,11 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add("array access of non array",
\\export fn f() void {
\\ var bad : bool = undefined;
- \\ bad[bad] = bad[bad];
+ \\ bad[0] = bad[0];
\\}
\\export fn g() void {
\\ var bad : bool = undefined;
- \\ _ = bad[bad];
+ \\ _ = bad[0];
\\}
, &[_][]const u8{
"tmp.zig:3:8: error: array access of non-array type 'bool'",