aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/indexing_non-tuple_struct.zig
blob: 1691faaae08d4c48bbcc714754f079a9fe553304 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
export fn a() void {
    const S = struct { x: i32, y: i32 };
    var s: S = undefined;
    s[0] = 10;
}

// error
// backend=stage2
// target=native
//
// :4:6: error: type 'tmp.a.S' does not support indexing
// :4:6: note: operand must be an array, slice, tuple, or vector