aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-08-29 14:10:59 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-08-29 14:10:59 -0700
commitde7270028d2b70ceea74c43be943b1b788c797a6 (patch)
tree0d9b545a2a9d36c86b79178f797adf5ebcd40d17 /test/behavior/basic.zig
parent7c9a8ecc2aca7f925e59d282540ef8e2d1ae211e (diff)
parente69973beddcd8a42dbc7ebcfb96187e5a6f61b61 (diff)
downloadzig-de7270028d2b70ceea74c43be943b1b788c797a6.tar.gz
zig-de7270028d2b70ceea74c43be943b1b788c797a6.zip
Merge remote-tracking branch 'origin/master' into llvm15
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index 1a1412420a..4d8b176fbf 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -1104,3 +1104,24 @@ test "namespace lookup ignores decl causing the lookup" {
};
_ = S.foo();
}
+
+test "ambiguous reference error ignores current declaration" {
+ const S = struct {
+ const foo = 666;
+
+ const a = @This();
+ const b = struct {
+ const foo = a.foo;
+ const bar = struct {
+ bar: u32 = b.foo,
+ };
+
+ comptime {
+ _ = b.foo;
+ }
+ };
+
+ usingnamespace b;
+ };
+ try expect(S.b.foo == 666);
+}