diff options
Diffstat (limited to 'test/behavior/basic.zig')
| -rw-r--r-- | test/behavior/basic.zig | 21 |
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); +} |
