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

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