12.5.5 Formal Interface Types
This rule follows from the rule in 12.5
says that the category is determined by the one given in the name of
the syntax production. The effect of the rule is repeated here to give
a capsule summary of what this subclause is about.
Ramification: Here we're taking advantage
of our switch in terminology from “determined class” to “determined
category”; by saying “category” rather than “class”,
we require that any actual type be an interface type, not just some type
derived from an interface type.
The actual type shall be a descendant of every progenitor of the formal
The actual type shall be a limited, task, protected, or synchronized
interface if and only if the formal type is also, respectively, a limited,
task, protected, or synchronized interface.
Discussion: We require the kind of interface
type to match exactly because without that it is almost impossible to
properly implement the interface.
Example of the use of a generic with a formal
interface type, to establish a standard interface that all tasks need
to implement so they can be managed appropriately by an application-specific
Managed_Task is task interface
Work_Item(<>) is new
Root_Work_Item with private
Server is new
Start(Data : in out
This generic allows an application to establish
a standard interface that all tasks need to implement so they can be
managed appropriately by an application-specific scheduler.
Extensions to Ada 95
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe