aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/array_access_of_non_array.zig
blob: 4bcb9bd237974c6998c84739a7d24f6d8019f42d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export fn f() void {
    var bad: bool = undefined;
    bad[0] = bad[0];
}
export fn g() void {
    const bad: bool = undefined;
    _ = bad[0];
}

// error
// backend=stage2
// target=native
//
// :3:8: error: type 'bool' does not support indexing
// :3:8: note: operand must be an array, slice, tuple, or vector
// :7:12: error: type 'bool' does not support indexing
// :7:12: note: operand must be an array, slice, tuple, or vector