diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-16 19:57:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-16 19:57:22 -0400 |
| commit | a12abc6d6c8b89a09befdcbd9019247ccc3bd641 (patch) | |
| tree | 55d95c1c99ddebc36cb4877b52b28ea406c73e5b /test/behavior/basic.zig | |
| parent | 9d85335de9f89213ed0c3f6a1ba4be1e02d186a1 (diff) | |
| parent | 9d4561ef0082728bbba085e8a4689ccc93a37b27 (diff) | |
| download | zig-a12abc6d6c8b89a09befdcbd9019247ccc3bd641.tar.gz zig-a12abc6d6c8b89a09befdcbd9019247ccc3bd641.zip | |
Merge pull request #12456 from Vexu/stage2
Stage2 namespacing fixes
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); +} |
