aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/array_access_of_non_array.zig
blob: 0f06bae1dd011a84551c8a0cbf2454014dd810f0 (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 {
    var 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