diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-08-24 18:56:16 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-08-24 22:35:37 -0700 |
| commit | 9c95f38a7c1defc7f63a4815bfc2d76a5f9f83f6 (patch) | |
| tree | 3182a24f22da9da86b56d8894b4bd603e89e10e3 /test/behavior/struct.zig | |
| parent | f1f28af1880a79bb2d7210d3a704c78698f0b45b (diff) | |
| download | zig-9c95f38a7c1defc7f63a4815bfc2d76a5f9f83f6.tar.gz zig-9c95f38a7c1defc7f63a4815bfc2d76a5f9f83f6.zip | |
stage1: remove incorrect compile error for var redeclaration
Locals are not allowed to shadow declarations, but declarations are
allowed to shadow each other, as long as there are no ambiguous
references.
closes #678
Diffstat (limited to 'test/behavior/struct.zig')
| -rw-r--r-- | test/behavior/struct.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/behavior/struct.zig b/test/behavior/struct.zig index 4f7e0c2d71..d9e1c02aa1 100644 --- a/test/behavior/struct.zig +++ b/test/behavior/struct.zig @@ -162,14 +162,14 @@ const MemberFnRand = struct { }; test "return struct byval from function" { - const bar = makeBar(1234, 5678); + const bar = makeBar2(1234, 5678); try expect(bar.y == 5678); } const Bar = struct { x: i32, y: i32, }; -fn makeBar(x: i32, y: i32) Bar { +fn makeBar2(x: i32, y: i32) Bar { return Bar{ .x = x, .y = y, |
