Spec-Zone.ru › Ada 2022
Ada Reference Manual (Ada 2022)

8.5.5 Generic Renaming Declarations

A generic_renaming_declaration is used to rename a generic unit.

Syntax

generic_renaming_declaration ::=
generic package defining_program_unit_name renames generic_package_name
[aspect_specification];
| generic procedure defining_program_unit_name renames generic_procedure_name
[aspect_specification];
| generic function defining_program_unit_name renames generic_function_name
[aspect_specification];

Legality Rules

The renamed entity shall be a generic unit of the corresponding kind.

Static Semantics

A generic_renaming_declaration declares a new view of the renamed generic unit.
NOTE Although the properties of the new view are the same as those of the renamed view, the place where the generic_renaming_declaration occurs can affect the legality of subsequent renamings and instantiations that denote the generic_renaming_declaration, in particular if the renamed generic unit is a library unit (see 10.1.1).

Examples

Example of renaming a generic unit:
generic package Enum_IO renames Ada.Text_IO.Enumeration_IO; -- see A.10.10


Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API