Error when trying to elaborate a field of a simple variable

This commit is contained in:
Cary R 2025-07-16 23:35:40 -07:00
parent eceb48e5d6
commit c7d37bcc21
4 changed files with 23 additions and 1 deletions

View File

@ -4979,7 +4979,15 @@ NetExpr* PEIdent::elaborate_expr_(Design*des, NetScope*scope,
expr, {});
}
ivl_assert(*this, sr.path_tail.empty());
if (! sr.path_tail.empty()) {
cerr << get_fileline() << ": error: Variable "
<< sr.path_head
<< " does not have a field named: "
<< sr.path_tail << "." << endl;
des->errors += 1;
return 0;
}
NetExpr*tmp = elaborate_expr_net(des, scope, sr.net, sr.scope,
expr_wid, flags);

View File

@ -0,0 +1,3 @@
./ivltests/br_gh1173.v:9: error: Variable id_3 does not have a field named: id_2.
./ivltests/br_gh1173.v:9: error: Unable to elaborate r-value: id_3.id_2
2 error(s) during elaboration.

View File

@ -0,0 +1,10 @@
module module_0 (
id_2,
id_3,
id_18,
);
inout id_18;
input id_3;
inout id_2;
assign id_18 = id_3.id_2;
endmodule

View File

@ -356,6 +356,7 @@ br_gh889 normal,-gspecify ivltests gold=br_gh889.gold
br_gh956a CE ivltests gold=br_gh956a.gold
br_gh956b CE ivltests gold=br_gh956b.gold
br_gh1117 CE ivltests gold=br_gh1117.gold
br_gh1173 CE ivltests gold=br_gh1173.gold
br_gh1175a CE ivltests gold=br_gh1175a.gold
br_gh1175b CE ivltests gold=br_gh1175b.gold
br_gh1175c CE ivltests gold=br_gh1175c.gold