aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/assign_through_constant_slice.zig
blob: 8f8068c620dcef3d44db590bb5cc6dfe5df86cfc (plain)
1
2
3
4
5
6
7
8
export fn f() void {
    var cstr: []const u8 = "Hat";
    cstr[0] = 'W';
}

// error
//
// :3:9: error: cannot assign to constant