Report when the task port return type does not match the connection

This commit is contained in:
Cary R
2026-09-04 15:47:59 -07:00
parent 9c738656e5
commit 31eef61e8d
4 changed files with 27 additions and 3 deletions
+13 -3
View File
@@ -4915,9 +4915,19 @@ NetProc* PCallTask::elaborate_build_call_(Design*des, NetScope*scope,
rv = cast_to_int4(rv, lv_width);
break;
default:
/* Don't yet know how to handle this. */
ivl_assert(*this, 0);
break;
cerr << get_fileline() << ": error: "
<< "Argument " << (idx+1) << " for task '"
<< task->basename() << "' is called with '";
lv->dump_lval(cerr);
cerr << "' which has type '"
<< lv->expr_type() << "'." << endl;
cerr << get_fileline() << ": : "
"The task expects to return type '"
<< rv->expr_type() << "'." << endl;
des->errors += 1;
delete lv;
delete rv;
continue;
}
}
rv = pad_to_width(rv, lv_width, *this);
+3
View File
@@ -0,0 +1,3 @@
./ivltests/br_gh716.v:8: error: Argument 1 for task 't1' is called with 'bf' which has type 'darray'.
./ivltests/br_gh716.v:8: : The task expects to return type 'logic'.
1 error(s) during elaboration.
+10
View File
@@ -0,0 +1,10 @@
module test();
logic [7:0] bf [];
task t1(output logic [7:0] buffer);
buffer=0;
endtask
initial t1(bf);
endmodule
+1
View File
@@ -148,6 +148,7 @@ br_gh4a normal,-g2009 ivltests
br_gh72a normal,-g2009 ivltests gold=br_gh72a.gold
br_gh72b normal,-g2009 ivltests gold=br_gh72b.gold
br_gh72b_fail CE,-g2009 ivltests gold=br_gh72b_fail.gold
br_gh716 CE,-g2009 ivltests gold=br_gh716.gold
br_gh104a normal,-g2009 ivltests
br_gh104b normal,-g2009 ivltests
br_gh105a normal,-g2009 ivltests gold=br_gh105a.gold