aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/write_to_const_global_variable.zig
blob: 1383f7a1d5ee6f5d230e43fc6f83bffe552bfe95 (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
//
// :3:5: error: cannot assign to constant