Improve function call argument error to show target function (rewording)

This commit is contained in:
Wilson Snyder 2026-03-04 20:22:25 -05:00
parent c93f5256d4
commit 572f50126b
5 changed files with 14 additions and 14 deletions

View File

@ -1827,8 +1827,8 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp,
<< argp->prettyNameQ() << " in call to " << nodep->taskp()->verilogKwd()
<< " " << nodep->taskp()->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << '\n'
<< nodep->warnMore() << "... " << ucfirst(nodep->taskp()->verilogKwd())
<< " " << nodep->taskp()->prettyNameQ() << " declared here:\n"
<< nodep->warnMore() << "... Location of " << nodep->taskp()->verilogKwd()
<< " " << nodep->taskp()->prettyNameQ() << " declaration\n"
<< nodep->taskp()->warnContextSecondary());
// We'll just delete it; seems less error prone than making a false argument
VL_DO_DANGLING(argp->unlinkFrBack()->deleteTree(), argp);
@ -1856,9 +1856,9 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp,
<< nodep->taskp()->verilogKwd() << " "
<< nodep->taskp()->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << '\n'
<< nodep->warnMore() << "... "
<< ucfirst(nodep->taskp()->verilogKwd()) << " "
<< nodep->taskp()->prettyNameQ() << " declared here:\n"
<< nodep->warnMore() << "... Location of "
<< nodep->taskp()->verilogKwd() << " "
<< nodep->taskp()->prettyNameQ() << " declaration:\n"
<< nodep->taskp()->warnContextSecondary());
// We'll just delete it; seems less error prone than making a false argument
VL_DO_DANGLING(argp->unlinkFrBack()->deleteTree(), argp);

View File

@ -15,14 +15,14 @@
: ... note: In instance 't'
47 | c1 = new(3);
| ^~~
: ... Function 'new' declared here:
: ... Location of function 'new' declaration:
10 | function new();
| ^~~
%Error: t/t_class_new_bad.v:48:16: Too many arguments in call to function 'new'
: ... note: In instance 't'
48 | c2 = new(3);
| ^~~
: ... Function 'new' declared here:
: ... Location of function 'new' declaration:
15 | class ClsNoNew;
| ^~~~~
%Error: t/t_class_new_bad.v:49:12: Missing argument on non-defaulted argument 'i' in function call to FUNC 'new'

View File

@ -2,7 +2,7 @@
: ... note: In instance 't'
15 | cov1.sample(5, 1'b0, 42);
| ^~~~~~
: ... Function 'sample' declared here:
: ... Location of function 'sample' declaration:
9 | covergroup cg_with_sample(int init) with function sample (int addr, bit is_read = 1'b0);
| ^~~~~~~~~~~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.

View File

@ -7,7 +7,7 @@
: ... note: In instance 't'
10 | if (add(3'd1, 3'd2, 3'd3) != 0) $stop;
| ^~~
: ... Function 'add' declared here:
: ... Location of function 'add' declaration:
19 | function [2:0] add;
| ^~~
%Error: t/t_func_bad.v:11:7: Missing argument on non-defaulted argument 'y' in function call to TASK 'x'
@ -24,7 +24,7 @@
: ... note: In instance 't'
14 | f(.j(1), .no_such(2));
| ^
: ... Function 'f' declared here:
: ... Location of function 'f' declaration
37 | function automatic int f( int j = 1, int dup = 0 );
| ^
%Error: t/t_func_bad.v:15:19: Duplicate argument 'dup' in function call to FUNC 'f'
@ -35,7 +35,7 @@
: ... note: In instance 't'
16 | f(1,2,3);
| ^
: ... Function 'f' declared here:
: ... Location of function 'f' declaration:
37 | function automatic int f( int j = 1, int dup = 0 );
| ^
%Error: Exiting due to

View File

@ -1,7 +1,7 @@
%Error: t/t_let_arg_bad.v:13:18: Too many arguments in call to let 'NO_ARG'
13 | if (NO_ARG(10) != 10) $stop;
| ^~~~~~
: ... Let 'NO_ARG' declared here:
: ... Location of let 'NO_ARG' declaration:
9 | let NO_ARG = 10;
| ^~~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
@ -14,13 +14,13 @@
%Error: t/t_let_arg_bad.v:16:23: Too many arguments in call to let 'ONE_ARG'
16 | if (ONE_ARG(10, 20) != 10) $stop;
| ^~~~~~~
: ... Let 'ONE_ARG' declared here:
: ... Location of let 'ONE_ARG' declaration:
10 | let ONE_ARG(a) = 10;
| ^~~~~~~
%Error: t/t_let_arg_bad.v:17:20: No such argument 'b' in call to let 'ONE_ARG'
17 | if (ONE_ARG(.b(1)) != 10) $stop;
| ^~~~~~~
: ... Let 'ONE_ARG' declared here:
: ... Location of let 'ONE_ARG' declaration
10 | let ONE_ARG(a) = 10;
| ^~~~~~~
%Error: t/t_let_arg_bad.v:17:11: Missing argument on non-defaulted argument 'a' in function call to LET 'ONE_ARG'