Fix interface and struct pattern collision (#5640) (#5639)

This commit is contained in:
Todd Strader
2024-11-27 17:20:21 -05:00
committed by GitHub
parent 99daa8d24b
commit 94e545bdca
4 changed files with 138 additions and 6 deletions
+11 -3
View File
@@ -2760,9 +2760,17 @@ class LinkDotResolveVisitor final : public VNVisitor {
// Lookup
if (VSymEnt* const foundp = m_curSymp->findIdFallback(textp->text())) {
if (AstVar* const varp = VN_CAST(foundp->nodep(), Var)) {
// Attach found Text reference to PatMember
nodep->varrefp(new AstVarRef{nodep->fileline(), varp, VAccess::READ});
UINFO(9, indent() << " new " << nodep->varrefp() << endl);
if (varp->isParam() || varp->isGenVar()) {
// Attach found Text reference to PatMember
nodep->varrefp(new AstVarRef{nodep->fileline(), varp, VAccess::READ});
UINFO(9, indent() << " new " << nodep->varrefp() << endl);
}
}
if (AstEnumItem* const itemp = VN_CAST(foundp->nodep(), EnumItem)) {
// Attach enum item value to PatMember
nodep->varrefp(
new AstEnumItemRef{nodep->fileline(), itemp, foundp->classOrPackagep()});
UINFO(9, indent() << " new " << itemp << endl);
}
}
}