diff --git a/elaborate.cc b/elaborate.cc index 3b1ac3fb0..7c908866f 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -4340,9 +4340,15 @@ 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; + /* Cannot cast between these types. */ + cerr << get_fileline() << ": error: " + << "Type of task port " << (idx+1) + << " is not compatible with the argument type." + << endl; + des->errors += 1; + delete rv; + delete lv; + continue; } } rv = pad_to_width(rv, lv_width, *this); diff --git a/ivtest/gold/br_gh716.gold b/ivtest/gold/br_gh716.gold new file mode 100644 index 000000000..1b10e3aa4 --- /dev/null +++ b/ivtest/gold/br_gh716.gold @@ -0,0 +1,2 @@ +./ivltests/br_gh716.v:11: error: Type of task port 1 is not compatible with the argument type. +1 error(s) during elaboration. diff --git a/ivtest/ivltests/br_gh716.v b/ivtest/ivltests/br_gh716.v new file mode 100644 index 000000000..19fa0e49d --- /dev/null +++ b/ivtest/ivltests/br_gh716.v @@ -0,0 +1,13 @@ +// Test for GitHub issue #716 +// Undimensioned array passed to task expecting single vector should error +module test(); + logic [7:0] mybuf []; + + task t1(output logic [7:0] buffer); + buffer = 0; + endtask + + initial begin + t1(mybuf); + end +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index 82b28c304..df5dc567f 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -223,6 +223,7 @@ br_gh661a normal,-g2009 ivltests br_gh661b normal,-g2009 ivltests br_gh672 normal,-g2009 ivltests br_gh699 CE,-g2009 ivltests +br_gh716 CE,-g2012 ivltests gold=br_gh716.gold br_gh756 normal,-g2009 ivltests br_gh782a normal,-g2009 ivltests gold=br_gh782a.gold br_gh782b normal,-g2009 ivltests gold=br_gh782b.gold