From 6c69210037d555241e1e356d97d7fcb5072506a0 Mon Sep 17 00:00:00 2001 From: Krzysztof Bieganski Date: Wed, 10 Sep 2025 13:09:55 +0200 Subject: [PATCH] Fix multiple resolution of classes, broke recently (#6396) (#6410) (#6413) Signed-off-by: Krzysztof Bieganski --- src/V3LinkDot.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index c192cea42..6b4ecb82d 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -1693,6 +1693,9 @@ class LinkDotFindVisitor final : public VNVisitor { VSymEnt* const impp = srcp->findIdFlat(nodep->name()); if (!impp) { nodep->v3error("Import object not found: " << nodep->prettyPkgNameQ()); + } else if (nodep->resolvedClassp()) { + UASSERT_OBJ(nodep->resolvedClassp()->classOrPackageSkipp() == impp->nodep(), nodep, + "Import should resolve to the same node"); } else if (AstClass* const classp = VN_CAST(impp->nodep(), Class)) { nodep->resolvedClassp( new AstClassOrPackageRef{nodep->fileline(), classp->name(), classp, nullptr});