aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/write_to_const_global_variable.zig
blob: eaa9353f000e1a8f59801c3ebb4505ce2d10eac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
const x : i32 = 99;
fn f() void {
    x = 1;
}
export fn entry() void { f(); }

// error
// backend=stage2
// target=native
//
// :3:9: error: cannot assign to constant