Improve error message when variable used as data type (#7318)

Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
This commit is contained in:
Ryszard Rozak 2026-03-24 09:45:09 +01:00 committed by GitHub
parent 3b328d2bb6
commit 9a01a4054a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -5900,7 +5900,9 @@ class LinkDotResolveVisitor final : public VNVisitor {
} else {
if (foundp) {
UINFO(1, "Found sym node: " << foundp->nodep());
nodep->v3error("Expecting a data type: " << nodep->prettyNameQ());
nodep->v3error("Expecting a data type: "
<< nodep->prettyNameQ()
<< ", found: " << foundp->nodep()->prettyTypeName());
} else {
nodep->v3error("Can't find typedef/interface: " << nodep->prettyNameQ());
}

View File

@ -1,4 +1,4 @@
%Error: t/t_lparam_assign_iface_typedef_bad.v:28:3: Expecting a data type: 'p0_rq_t'
%Error: t/t_lparam_assign_iface_typedef_bad.v:28:3: Expecting a data type: 'p0_rq_t', found: VAR 'p0_rq_t'
28 | p0_rq_t rq;
| ^~~~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.

View File

@ -1,4 +1,4 @@
%Error: t/t_struct_type_bad.v:13:5: Expecting a data type: 'i'
%Error: t/t_struct_type_bad.v:13:5: Expecting a data type: 'i', found: VAR 'i'
13 | i badi;
| ^
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.