diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 368f2ef29..885388f68 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -2121,6 +2121,10 @@ private: v3Global.rootp()->typeTablep()->addTypesp(newp); } } + if (AstWildcardArrayDType* const wildp + = VN_CAST(nodep->dtypeSkipRefp(), WildcardArrayDType)) { + nodep->dtypep(wildp); // Skip RefDType like for other dynamic array types + } if (VN_IS(nodep->dtypep()->skipRefToConstp(), ConstDType)) nodep->isConst(true); // Parameters if implicit untyped inherit from what they are assigned to const AstBasicDType* const bdtypep = VN_CAST(nodep->dtypep(), BasicDType); diff --git a/test_regress/t/t_assoc_wildcard.v b/test_regress/t/t_assoc_wildcard.v index 2d4e5c782..28fa62037 100644 --- a/test_regress/t/t_assoc_wildcard.v +++ b/test_regress/t/t_assoc_wildcard.v @@ -22,10 +22,15 @@ module t (/*AUTOARG*/ cyc <= cyc + 1; begin // Wildcard + typedef string dict_t [*]; string a [*] = '{default: "nope", "BBBBB": "fooing", 23'h434343: "baring"}; + dict_t b = '{default: "nope", "BBBBB": "fooing", 23'h434343: "baring"}; int k; string v; + v = b["CCC"]; `checks(v, "baring"); + v = b["BBBBB"]; `checks(v, "fooing"); + v = a["CCC"]; `checks(v, "baring"); v = a["BBBBB"]; `checks(v, "fooing");