Activate wildcard imports for class copy construction

The source expression of a class copy constructor currently bypasses
`pform_new_ident()`. An identifier made visible by a wildcard package import
is therefore not activated and can not be resolved during elaboration.

Create the source expression through `pform_new_ident()`, matching ordinary
identifier expressions and preserving the source location.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2026-08-02 15:30:20 -07:00
parent b1635c21cc
commit d05b13b604
1 changed files with 2 additions and 3 deletions

View File

@ -1426,9 +1426,8 @@ class_new /* IEEE1800-2005 A.2.4 */
$$ = new_expr;
}
| K_new hierarchy_identifier
{ PEIdent*tmpi = new PEIdent(*$2, @2.lexical_pos);
FILE_NAME(tmpi, @2);
PENewCopy*tmp = new PENewCopy(tmpi);
{ auto tmpi = pform_new_ident(@2, *$2);
auto tmp = new PENewCopy(tmpi);
FILE_NAME(tmp, @1);
delete $2;
$$ = tmp;