Fix extending a class by a typedef (#6679)
This commit is contained in:
parent
742c0b134c
commit
055bcab408
|
|
@ -273,6 +273,7 @@ Yutetsu TAKATSUKASA
|
|||
Yves Mathieu
|
||||
Zhanglei Wang
|
||||
Zhen Yan
|
||||
Zhou Qinnan (Alex)
|
||||
Zhou Shen
|
||||
Zhouyi Shen
|
||||
Zixi Li
|
||||
|
|
|
|||
|
|
@ -5016,6 +5016,23 @@ class LinkDotResolveVisitor final : public VNVisitor {
|
|||
refParamp->refDTypep(paramp);
|
||||
nodep->childDTypep(refParamp);
|
||||
nodep->parameterized(true);
|
||||
} else if (AstTypedef* const typedefp = VN_CAST(foundp->nodep(), Typedef)) {
|
||||
AstNodeDType* const unwrappedp = typedefp->subDTypep()->skipRefp(); // Unwrap typedef to get the underlying type
|
||||
if (AstClassRefDType* const classRefp = VN_CAST(unwrappedp, ClassRefDType)) {
|
||||
AstPin* paramsp = cpackagerefp->paramsp();
|
||||
if (paramsp) {
|
||||
paramsp = paramsp->cloneTree(true);
|
||||
nodep->parameterized(true);
|
||||
}
|
||||
nodep->childDTypep(new AstClassRefDType{nodep->fileline(), classRefp->classp(), paramsp});
|
||||
iterate(nodep->childDTypep());
|
||||
}
|
||||
else {
|
||||
nodep->v3warn(E_UNSUPPORTED,
|
||||
"Unsupported: " << foundp->nodep()->prettyTypeName()
|
||||
<< " in 'class extends'");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
nodep->v3warn(E_UNSUPPORTED,
|
||||
"Unsupported: " << foundp->nodep()->prettyTypeName()
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@
|
|||
|
||||
import vltest_bootstrap
|
||||
|
||||
test.scenarios('linter')
|
||||
test.scenarios('simulator')
|
||||
|
||||
test.lint(fails=True, expect_filename=test.golden_filename)
|
||||
test.compile()
|
||||
|
||||
test.passes()
|
||||
test.execute()
|
||||
|
||||
test.passes()
|
||||
Loading…
Reference in New Issue