Fix typedef through a parameterized sub-interface (#7943 repair) (#8124) (#8128)

This commit is contained in:
em2machine
2026-09-23 14:32:23 -04:00
committed by GitHub
parent e6ecf3a014
commit f82cdbeaa7
8 changed files with 184 additions and 56 deletions
+13
View File
@@ -2360,6 +2360,19 @@ class WidthVisitor final : public VNVisitor {
case VAttrType::DIM_SIZE: {
AstNodeDType* const dtypep = fromDTypep(nodep->fromp());
UASSERT_OBJ(dtypep, nodep, "Unsized expression");
// Only worth asking while parameters are still being worked out.
if (m_paramsOnly) {
// A module that is still being copied does not have its final sizes.
const AstNodeModule* const ownModp = v3Global.rootp()->containingModule(dtypep);
if (ownModp && ownModp->parameterizedTemplate() && !ownModp->dead()) {
UINFO(9, "size deferred, type still on template " << ownModp->name());
// These queries always give an int, so set that now and let the
// value be worked out once the copy exists.
nodep->dtypeSetInt();
return;
}
}
if (VN_IS(dtypep, QueueDType) || VN_IS(dtypep, DynArrayDType)) {
switch (nodep->attrType()) {
case VAttrType::DIM_SIZE: {