There are three levels of type compatibility. Each level along with its
restrictions is listed below in order, from the most restrictive to the
least restrictive.
Equivalent Types.
Two types are equivalent only if they are both defined from the same type
declaration. That declaration must be one if the following:
A named type declared by a type declaration.
A predeclared type.
An unnamed type used in a declaration.
Compatible Types
Two types are compatible if one of the following apply:
Both are equivalent.
One type is a subrange of another.
Both are subranges of the same type.
Both types are integers.
Both types are reals.
Both types are strings.
One is a char or array of char and the other is a string.
Both are set types and their base types are compatible.
Both are arrays of char with the same length.
Assignable Types
A type is assignable to another type if one of the following apply:
Both types are compatible.
Assignment of an integer type to a real type.
Assignment of a char type to a string type.
An array of characters less than 256 characters to a string.