aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/assign_to_constant_field.zig
blob: 074398f79985730242060c124bffbe01292d9967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const Foo = struct {
    field: i32,
};
export fn derp() void {
    const f = Foo{
        .field = 1234,
    };
    f.field = 0;
}

// error
//
// :8:6: error: cannot assign to constant