You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: renaming a package variable fails
– currently unsupported:
Var : ET.New_Integer renames ET.External_Var;
This task lies somewhere between "support for renaming" and "support for packages".
Consider the test case below
procedure Declaration_Rename is
A : Integer := 1;
B : Integer;
New_Integer_With_Complicated_Name : Integer := 11;
Simply_Named_Int : Integer renames New_Integer_With_Complicated_Name;
function My_Plus(Left, Right : Integer) return Integer renames "+";
package ET renames External_Types;
– without a 'use' package clause (which would make the package renaming redundant)
– the operator must also be explicitly renamed
– (this operator is required for the 'pragma Assert'
function "=" (Left, Right: ET.New_Integer) return Boolean renames ET."=";
– currently unsupported.
Var : ET.New_Integer renames ET.External_Var;
C : ET.New_Integer := 4;
begin
A := A + 1;
B := A + 1;
Var := 5;
pragma Assert (B=3);
pragma Assert (Simply_Named_Int=11);
pragma Assert (My_Plus(A,B)=5);
pragma Assert (C=4);
pragma Assert (Var=4);
end Declaration_Rename;
All operations involving Var (in the example above an assignment statement and equality expression) will cause failure in 'Do_Expression' with report:
The issue concerns also getting a fully qualified name:
-------------------
– Expanded Name –
-------------------
– The N_Expanded_Name node is used to represent a selected component
– name that has been resolved to an expanded name. The semantic phase
– replaces N_Selected_Component nodes that represent names by the use
– of this node, leaving the N_Selected_Component node used only when
– the prefix is a record or protected type.
– The fields of the N_Expanded_Name node are layed out identically
– to those of the N_Selected_Component node, allowing conversion of
– an expanded name node to a selected component node to be done
– easily, see Sinfo.CN.Change_Selected_Component_To_Expanded_Name.
– There is no special sprint syntax for an expanded name
– N_Expanded_Name
– Sloc points to the period
– Chars (Name1) copy of Chars field of selector name
– Prefix (Node3)
– Selector_Name (Node2)
– Entity (Node4-Sem)
– Associated_Node (Node4-Sem)
– Has_Private_View (Flag11-Sem) set in generic units.
– Redundant_Use (Flag13-Sem)
– Atomic_Sync_Required (Flag14-Sem)
– plus fields for expression
The prefix here is apparently what we'd need for a FQN, but it is uncertain if just that much will be enough to get it to work;
The text was updated successfully, but these errors were encountered:
Summary: renaming a package variable fails
– currently unsupported:
Var : ET.New_Integer renames ET.External_Var;
This task lies somewhere between "support for renaming" and "support for packages".
Consider the test case below
All operations involving Var (in the example above an assignment statement and equality expression) will cause failure in 'Do_Expression' with report:
The issue concerns also getting a fully qualified name:
The prefix here is apparently what we'd need for a FQN, but it is uncertain if just that much will be enough to get it to work;
The text was updated successfully, but these errors were encountered: