| ... | ... | @@ -5658,14 +5658,14 @@ fn lookupInNamespace( |
| 5658 | 5658 | const src_file = block.namespace.file_scope; |
| 5659 | 5659 | |
| 5660 | 5660 | const gpa = sema.gpa; |
| 5661 | | var checked_namespaces: std.AutoArrayHashMapUnmanaged(*Namespace, void) = .{}; |
| 5661 | var checked_namespaces: std.AutoArrayHashMapUnmanaged(*Namespace, bool) = .{}; |
| 5662 | 5662 | defer checked_namespaces.deinit(gpa); |
| 5663 | 5663 | |
| 5664 | 5664 | // Keep track of name conflicts for error notes. |
| 5665 | 5665 | var candidates: std.ArrayListUnmanaged(Decl.Index) = .{}; |
| 5666 | 5666 | defer candidates.deinit(gpa); |
| 5667 | 5667 | |
| 5668 | | try checked_namespaces.put(gpa, namespace, {}); |
| 5668 | try checked_namespaces.put(gpa, namespace, namespace.file_scope == src_file); |
| 5669 | 5669 | var check_i: usize = 0; |
| 5670 | 5670 | |
| 5671 | 5671 | while (check_i < checked_namespaces.count()) : (check_i += 1) { |
| ... | ... | @@ -5674,7 +5674,7 @@ fn lookupInNamespace( |
| 5674 | 5674 | // Skip decls which are not marked pub, which are in a different |
| 5675 | 5675 | // file than the `a.b`/`@hasDecl` syntax. |
| 5676 | 5676 | const decl = mod.declPtr(decl_index); |
| 5677 | | if (decl.is_pub or src_file == decl.getFileScope()) { |
| 5677 | if (decl.is_pub or (src_file == decl.getFileScope() and checked_namespaces.values()[check_i])) { |
| 5678 | 5678 | try candidates.append(gpa, decl_index); |
| 5679 | 5679 | } |
| 5680 | 5680 | } |
| ... | ... | @@ -5693,7 +5693,7 @@ fn lookupInNamespace( |
| 5693 | 5693 | try sema.ensureDeclAnalyzed(sub_usingnamespace_decl_index); |
| 5694 | 5694 | const ns_ty = sub_usingnamespace_decl.val.castTag(.ty).?.data; |
| 5695 | 5695 | const sub_ns = ns_ty.getNamespace().?; |
| 5696 | | try checked_namespaces.put(gpa, sub_ns, {}); |
| 5696 | try checked_namespaces.put(gpa, sub_ns, src_file == sub_usingnamespace_decl.getFileScope()); |
| 5697 | 5697 | } |
| 5698 | 5698 | } |
| 5699 | 5699 | |