aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/decl_shadows_local.zig
blob: 2333de8820d2182f56f78e0c1ef1c15cf219dda8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
fn foo(a: usize) void {
    struct {
        const a = 1;
    };
    _ = a;
}
fn bar(a: usize) void {
    struct {
        const b = struct {
            const a = 1;
        };
    };
    _ = a;
}

// error
//
// :3:15: error: declaration 'a' shadows function parameter from outer scope
// :1:8: note: previous declaration here
// :10:19: error: declaration 'a' shadows function parameter from outer scope
// :7:8: note: previous declaration here