Skip to content

Commit 4730ae7

Browse files
committed
fix: merge namespaces when collecting results
1 parent 5ee5c49 commit 4730ae7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/lib/Lib/ExecutionContext.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "ExecutionContext.hpp"
1515
#include "lib/Metadata/Reduce.hpp"
1616
#include <mrdocs/Metadata.hpp>
17+
#include <mrdocs/Metadata/Info/Namespace.hpp>
1718
#include <ranges>
1819

1920
namespace clang {
@@ -69,7 +70,16 @@ report(
6970
{
7071
auto it = info_.find(other->id);
7172
MRDOCS_ASSERT(it != info_.end());
72-
merge(**it, std::move(*other));
73+
if (auto ns = dynamic_cast<NamespaceInfo*>(it->get()))
74+
{
75+
auto otherNs = dynamic_cast<NamespaceInfo*>(other.get());
76+
MRDOCS_ASSERT(otherNs);
77+
merge(*ns, std::move(*otherNs));
78+
}
79+
else
80+
{
81+
merge(**it, std::move(*other));
82+
}
7383
}
7484

7585
// Merge diagnostics and report any new messages.

0 commit comments

Comments
 (0)