Add error when scalar is passed to array task argument (#7948)

This commit is contained in:
Pawel Klopotek
2026-07-22 07:54:58 -04:00
committed by GitHub
parent 8113f1df7a
commit f149dd304c
5 changed files with 78 additions and 3 deletions
+8
View File
@@ -7507,6 +7507,14 @@ class WidthVisitor final : public VNVisitor {
relinkHandle.relink(newp);
}
if (portp->isWritable()) V3LinkLValue::linkLValueSet(pinp);
if (VN_IS(pinDTypep, BasicDType) && portp->direction() != VDirection::REF
&& (VN_IS(portDTypep, UnpackArrayDType) || VN_IS(portDTypep, DynArrayDType)
|| VN_IS(portDTypep, QueueDType) || VN_IS(portDTypep, AssocArrayDType))) {
pinp->v3error("Function Argument expects " << portDTypep->prettyDTypeNameQ()
<< ", got "
<< pinDTypep->prettyDTypeNameQ());
continue;
}
if (!portp->basicp() || portp->basicp()->isOpaque()) {
// Output args: at return caller = callee, reverse direction.
checkClassAssign(nodep, "Function Argument", pinp, portDTypep,