Meg's Mirrors
zig
about
heads
tags
log
tree
search
Search
zig
test
cases
compile_errors
reassign_to_struct_parameter.zig
pretty
plain
permalink
blame
history
•
13 lines
•
191 B
1
const S = struct {
2
x: u32,
3
};
4
fn reassign(s: S) void {
5
s = S{ .x = 2 };
6
}
7
export fn entry() void {
8
reassign(S{ .x = 3 });
9
}
10
11
// error
12
//
13
// :5:5: error: cannot assign to constant