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 <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2023-06-17 11:36:06 -07:00
parent 44bc9cba03
commit bc3cb04a41
1 changed files with 7 additions and 1 deletions

View File

@ -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<const netarray_t*>(prop_type);
ivl_assert(*this, array_type);
set_net_type(array_type->element_type());
} else {
set_net_type(prop_type);
}
}
NetEProperty::~NetEProperty()