Go to the first, previous, next, last section, table of contents.


8.5.1 Object Renaming Declarations

  1. An object_renaming_declaration is used to rename an object.

    Syntax

  2. object_renaming_declaration ::=
       defining_identifier : subtype_mark renames object_name;
    

    Name Resolution Rules

  3. The type of the object_name shall resolve to the type determined by the subtype_mark.

    Legality Rules

  4. The renamed entity shall be an object.
  5. The renamed entity shall not be a subcomponent that depends on discriminants of a variable whose nominal subtype is unconstrained, unless this subtype is indefinite, or the variable is aliased. A slice of an array shall not be renamed if this restriction disallows renaming of the array.

    Static Semantics

  6. An object_renaming_declaration declares a new view of the renamed object whose properties are identical to those of the renamed view. Thus, the properties of the renamed object are not affected by the renaming_declaration. In particular, its value and whether or not it is a constant are unaffected; similarly, the constraints that apply to an object are not affected by renaming (any constraint implied by the subtype_mark of the object_renaming_declaration is ignored).

    Examples

  7. Example of renaming an object:
  8. declare
       L : Person renames Leftmost_Person;  -- See section 3.10.1 Incomplete Type Declarations
    begin
       L.Age := L.Age + 1;
    end;
    


Go to the first, previous, next, last section, table of contents.