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

11 lines
163 B
Zig

export fn f() void {
var cstr: []const u8 = "Hat";
cstr[0] = 'W';
}
// error
// backend=stage2
// target=native
//
// :3:13: error: cannot assign to constant