aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/assign_to_constant_field.zig
blob: 4c79b295928bf1da21bcf3f82fe5aa19d97f880e (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
// backend=stage2
// target=native
//
// :6:15: error: cannot assign to constant