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

// error
// backend=stage2
// target=native
//
// :3:15: error: redeclaration of function parameter 'a'
// :1:8: note: previous declaration here
// :9:19: error: redeclaration of function parameter 'a'
// :6:8: note: previous declaration here