diff --git a/elab_expr.cc b/elab_expr.cc index 33a4f44e1..fecbf7f32 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -3838,6 +3838,19 @@ NetExpr* PECallFunction::elaborate_expr_method_(Design*des, NetScope*scope, des->errors += 1; return 0; } + if (with_expr_) { + if (!parms_.empty()) { + cerr << get_fileline() << ": error: array locator " + << "`with` clause cannot be combined with a " + << "method argument." << endl; + des->errors += 1; + return 0; + } + return elab_queue_locator_with_predicate( + des, scope, *this, with_expr_, prop, + element_type, static_cast(queue), + method_name); + } NetESFunc*sys_expr = new NetESFunc( method_name == "min" ? "$ivl_queue_method$min" : "$ivl_queue_method$max", diff --git a/ivtest/ivltests/sv_class_queue_prop_locators.v b/ivtest/ivltests/sv_class_queue_prop_locators.v index 2824a8a11..6c91355fc 100644 --- a/ivtest/ivltests/sv_class_queue_prop_locators.v +++ b/ivtest/ivltests/sv_class_queue_prop_locators.v @@ -49,6 +49,10 @@ module test; `check(r[0], 1); `check(r[1], 1); + r = c.q.max() with (item < 7); + `check(r.size, 1); + `check(r[0], 6); + r = c.q.max(); `check(r.size, 2); `check(r[0], 7);