| ... | @@ -4103,6 +4103,21 @@ pub fn scanNamespace( | ... | @@ -4103,6 +4103,21 @@ pub fn scanNamespace( |
| 4103 | for (decls) |decl_inst| { | 4103 | for (decls) |decl_inst| { |
| 4104 | try scanDecl(&scan_decl_iter, decl_inst); | 4104 | try scanDecl(&scan_decl_iter, decl_inst); |
| 4105 | } | 4105 | } |
| | 4106 | |
| | 4107 | if (seen_decls.count() != namespace.decls.count()) { |
| | 4108 | // Do a pass over the namespace contents and remove any decls from the last update |
| | 4109 | // which were removed in this one. |
| | 4110 | var i: usize = 0; |
| | 4111 | while (i < namespace.decls.count()) { |
| | 4112 | const decl_index = namespace.decls.keys()[i]; |
| | 4113 | const decl = zcu.declPtr(decl_index); |
| | 4114 | if (!seen_decls.contains(decl.name)) { |
| | 4115 | // We must preserve namespace ordering for @typeInfo. |
| | 4116 | namespace.decls.orderedRemoveAt(i); |
| | 4117 | i -= 1; |
| | 4118 | } |
| | 4119 | } |
| | 4120 | } |
| 4106 | } | 4121 | } |
| 4107 | | 4122 | |
| 4108 | const ScanDeclIter = struct { | 4123 | const ScanDeclIter = struct { |