Files
zig/test/cases/compile_errors/assign_through_constant_slice.zig
2023-06-19 12:34:42 -07:00

11 lines
166 B
Zig

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