6.6. Derived Types - JulTob/Ada GitHub Wiki

The simplest form of derived type introduces a new type which is almost identical to an existing type except that it is logically distinct. If we write

type Light is new Colour;
type My_Type is new Parent_Type;

Then Light will, like Colour, be an enumeration type with literals Red, Amber and Green.

However, the values of the two types cannot be arbitrarily mixed since they are logically distinct.

Nevertheless, in recognition of the close relationship, a value of one type can be converted to the other by explicitly using the destination type name.

So we can write

Declare 
   type Light is new Colour;
   C: Colour;
   L: Light;
begin
   L:= Amber;      --The light, not the colour.   Legal
   C:= Colour(L);  --Explicit conversion.         Legal
   C:= L;          --Implicit conversion.         Illegal AF
end