mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 13:58:27 +00:00
langref- fix use after block error code
This commit is contained in:
parent
5589edf45c
commit
32069d2330
@ -3422,10 +3422,11 @@ test "call foo" {
|
||||
<p>
|
||||
Blocks are used to limit the scope of variable declarations:
|
||||
</p>
|
||||
{#code_begin|test_err|unused local variable#}
|
||||
{#code_begin|test_err|use of undeclared identifier 'x'#}
|
||||
test "access variable after block scope" {
|
||||
{
|
||||
var x: i32 = 1;
|
||||
_ = x;
|
||||
}
|
||||
x += 1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user