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

// error
//
// :8:5: error: cannot assign to constant