diff options
| author | emma <39064859+ieeemma@users.noreply.github.com> | 2022-07-07 19:38:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-07 21:38:32 +0300 |
| commit | 81bbefe9b837dc439a68458ca91d522c1c49b96b (patch) | |
| tree | 796fd5138faa9b6312e5464ecd9266db5339f079 /test/cases/variable_shadowing.10.zig | |
| parent | c9006d9479c619d9ed555164831e11a04d88d382 (diff) | |
| download | zig-81bbefe9b837dc439a68458ca91d522c1c49b96b.tar.gz zig-81bbefe9b837dc439a68458ca91d522c1c49b96b.zip | |
AstGen: fix catch payoad not checking for shadowing
Diffstat (limited to 'test/cases/variable_shadowing.10.zig')
| -rw-r--r-- | test/cases/variable_shadowing.10.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/cases/variable_shadowing.10.zig b/test/cases/variable_shadowing.10.zig new file mode 100644 index 0000000000..6aa9f5a9bf --- /dev/null +++ b/test/cases/variable_shadowing.10.zig @@ -0,0 +1,9 @@ +fn foo() !void { + var i: anyerror!usize = 1; + _ = i catch |i| return i; +} + +// error +// +// :3:18: error: redeclaration of local variable 'i' +// :2:9: note: previous declaration here |
