Files
zig/test/cases/compile_errors/assign_to_constant_field.zig
2022-06-30 09:57:38 +02:00

14 lines
210 B
Zig

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