From 2f38adaeff8407ab8c540f9533fb9c8f6b91f46e Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 8 Apr 2022 10:46:16 +0200 Subject: [PATCH] Report correct queue method return type when call without parenthesis When calling a queue method without parenthesis it gets elaborated through the PEIdent path. On this path the type, width and signdess are not reported for the method call. This leads to incorrect behavior in contexts where those are important. Correctly report the type, the same as when the method is called with parenthesis. Signed-off-by: Lars-Peter Clausen --- elab_expr.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/elab_expr.cc b/elab_expr.cc index 939907b02..7bdaf06aa 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -3965,6 +3965,16 @@ unsigned PEIdent::test_width_method_(Design*des, NetScope*scope, width_mode_t&) } } + if (const struct netqueue_t *queue = net->queue_type()) { + if (member_name == "pop_back" || member_name == "pop_front") { + expr_type_ = queue->element_base_type(); + expr_width_ = queue->element_width(); + min_width_ = expr_width_; + signed_flag_ = queue->get_signed(); + return expr_width_; + } + } + // Look for the enumeration attributes. if (const netenum_t*netenum = net->enumeration()) { if (member_name == "num") {