Skip to content

Commit 13b1fcb

Browse files
committed
fix: merge namespaces when collecting results
1 parent 5ee5c49 commit 13b1fcb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib/Lib/ExecutionContext.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
#include "ExecutionContext.hpp"
1515
#include "lib/Metadata/Reduce.hpp"
16+
#include "mrdocs/Support/Assert.hpp"
1617
#include <mrdocs/Metadata.hpp>
18+
#include <mrdocs/Metadata/Info/Namespace.hpp>
1719
#include <ranges>
1820

1921
namespace clang {
@@ -69,7 +71,11 @@ report(
6971
{
7072
auto it = info_.find(other->id);
7173
MRDOCS_ASSERT(it != info_.end());
72-
merge(**it, std::move(*other));
74+
visit(**it, [&]<typename T>(T& target) {
75+
auto *source = dynamic_cast<T*>(other.get());
76+
MRDOCS_ASSERT(source);
77+
merge(target, std::move(*source));
78+
});
7379
}
7480

7581
// Merge diagnostics and report any new messages.

0 commit comments

Comments
 (0)