zig/test/cases/variable_shadowing.6.zig
Eric Joldasov 50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00

12 lines
222 B
Zig

pub fn main() void {
var i = 0;
while ("n") |bruh| {
_ = bruh;
} else |i| {}
}
// error
//
// :5:13: error: capture 'i' shadows local variable from outer scope
// :2:9: note: previous declaration here