aboutsummaryrefslogtreecommitdiff
path: root/test/cases/inner_func_accessing_outer_var.zig
blob: 6b774ea9be51f48c6f5bf808da0f988d663a15ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub fn f() void {
    var bar: bool = true;
    _ = &bar;
    const S = struct {
        fn baz() bool {
            return bar;
        }
    };
    _ = S;
}

// error
//
// :6:20: error: mutable 'bar' not accessible from here
// :2:9: note: declared mutable here
// :4:15: note: crosses namespace boundary here