From bc3cb04a413f6302e282cdeab71a42885fdb6d1f Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 17 Jun 2023 11:36:06 -0700 Subject: [PATCH] Set correct type for indexed array properties For indexed array properties the type of the expression is the type of the element. Signed-off-by: Lars-Peter Clausen --- net_expr.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net_expr.cc b/net_expr.cc index 1b0c5ec27..6460302fb 100644 --- a/net_expr.cc +++ b/net_expr.cc @@ -401,7 +401,13 @@ NetEProperty::NetEProperty(NetNet*net, size_t pidx, NetExpr*idx) ivl_assert(*this, use_type); ivl_type_t prop_type = use_type->get_prop_type(pidx_); - set_net_type(prop_type); + if (idx) { + auto array_type = dynamic_cast(prop_type); + ivl_assert(*this, array_type); + set_net_type(array_type->element_type()); + } else { + set_net_type(prop_type); + } } NetEProperty::~NetEProperty()