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

// error
//
// :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