aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-08-16 16:37:27 +0300
committerVeikka Tuominen <git@vexu.eu>2022-08-16 16:37:27 +0300
commitc17793b4875cc9e1ccb605431142ffecb0b6f3f2 (patch)
treec2304b0cb0458e8ea78e6a7575a414f84a071ea6 /src
parentb3922289be1ffaf194b55face332892280981356 (diff)
downloadzig-c17793b4875cc9e1ccb605431142ffecb0b6f3f2.tar.gz
zig-c17793b4875cc9e1ccb605431142ffecb0b6f3f2.zip
Sema: ignore current declaration in ambiguous reference error
Closes #12429
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 879ecb4e2f..d7d6994bcd 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -5384,6 +5384,17 @@ fn lookupInNamespace(
}
}
+ {
+ var i: usize = 0;
+ while (i < candidates.items.len) {
+ if (candidates.items[i] == sema.owner_decl_index) {
+ _ = candidates.orderedRemove(i);
+ } else {
+ i += 1;
+ }
+ }
+ }
+
switch (candidates.items.len) {
0 => {},
1 => {