aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/assign_to_constant_destructure.zig
blob: 7a416d54cbd5d534c79d1dadb39cbadcd4cdf7f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export fn a() void {
    const S = struct {
        fn b() struct { usize, usize } {
            return .{ 0, 0 };
        }
    };
    const c, _ = S.b();
    c += 10;
}

// error
// backend=stage2
// target=native
//
// :8:7: error: cannot assign to constant