aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/reassign_to_struct_parameter.zig
blob: 963448f8fe0e4a46424f40fbe5786dcf6d575b3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const S = struct {
    x: u32,
};
fn reassign(s: S) void {
    s = S{.x = 2};
}
export fn entry() void {
    reassign(S{.x = 3});
}

// error
// backend=stage2
// target=native
//
// :5:10: error: cannot assign to constant