@@ -1421,19 +1421,21 @@ exprt verilog_typecheck_exprt::convert_hierarchical_identifier(
14211421{
14221422 convert_expr (expr.lhs ());
14231423
1424- DATA_INVARIANT (expr.rhs ().id () == ID_symbol, " expected symbol on rhs of `.'" );
1424+ DATA_INVARIANT (
1425+ expr.rhs ().id () == ID_verilog_identifier,
1426+ " expected verilog_identifier as rhs of `.'" );
14251427
1426- const irep_idt &rhs_identifier = expr.rhs ().get_identifier ();
1428+ const irep_idt &rhs_base_name = expr.rhs ().base_name ();
14271429
14281430 if (expr.lhs ().type ().id () == ID_struct || expr.lhs ().type ().id () == ID_union)
14291431 {
14301432 // look up the component
14311433 auto &compound_type = to_struct_union_type (expr.lhs ().type ());
1432- auto &component = compound_type.get_component (rhs_identifier );
1434+ auto &component = compound_type.get_component (rhs_base_name );
14331435 if (component.is_nil ())
14341436 throw errort ().with_location (expr.source_location ())
14351437 << compound_type.id () << " does not have a member named "
1436- << rhs_identifier ;
1438+ << rhs_base_name ;
14371439
14381440 // create the member expression
14391441 return member_exprt{expr.lhs (), component.get_name (), component.type ()}
@@ -1467,7 +1469,7 @@ exprt verilog_typecheck_exprt::convert_hierarchical_identifier(
14671469
14681470 // the identifier in the module
14691471 const irep_idt full_identifier =
1470- id2string (module ) + " ." + id2string (rhs_identifier );
1472+ id2string (module ) + " ." + id2string (rhs_base_name );
14711473
14721474 const symbolt *symbol;
14731475 if (!ns.lookup (full_identifier, symbol))
@@ -1485,7 +1487,7 @@ exprt verilog_typecheck_exprt::convert_hierarchical_identifier(
14851487 else
14861488 {
14871489 throw errort ().with_location (expr.source_location ())
1488- << " identifier `" << rhs_identifier << " ' not found in module `"
1490+ << " identifier `" << rhs_base_name << " ' not found in module `"
14891491 << module_instance_symbol->pretty_name << " '" ;
14901492 }
14911493
@@ -1497,7 +1499,7 @@ exprt verilog_typecheck_exprt::convert_hierarchical_identifier(
14971499 else if (expr.lhs ().type ().id () == ID_named_block)
14981500 {
14991501 const irep_idt full_identifier =
1500- id2string (lhs_identifier) + " ." + id2string (rhs_identifier );
1502+ id2string (lhs_identifier) + " ." + id2string (rhs_base_name );
15011503
15021504 const symbolt *symbol;
15031505 if (!ns.lookup (full_identifier, symbol))
@@ -1519,7 +1521,7 @@ exprt verilog_typecheck_exprt::convert_hierarchical_identifier(
15191521 else
15201522 {
15211523 throw errort ().with_location (expr.source_location ())
1522- << " identifier `" << rhs_identifier << " ' not found in named block" ;
1524+ << " identifier `" << rhs_base_name << " ' not found in named block" ;
15231525 }
15241526 }
15251527 else
0 commit comments