Checking Typing
During the assignment of data objects to typed field symbols and actual parameters to typed formal parameters of
procedures, the system checks whether the
data type of the assigned data object for typing the field symbol or the formal parameter is matching.
The general rules for this check apply in strict manner for the assignment of all data objects to field
symbols and known data objects to formal parameters. In the assignment of literals to formal parameters, other rules apply in part (see Literals as Actual Parameters).
General Rules
The general rules for checking named data objects are:
- During the assignment to generically typed field symbols or formal parameters, the system checks
whether the data type of the assigned data object is a subset of the generic type. The type properties defined by the typing are adopted by the actual parameter.
- During assignment to completely typed field symbols or formal parameters, the data type of the assigned
data object must correspond exactly to the typing. Only with the specification of actual parameters to input parameters typed as a reference variable can the typing of the formal parameter in accordance with the rules for
up cast be more general than the type of the actual parameter if the content change in the procedure is completed.
- During the assignment to field symbols or formal parameters with a cast structure using the obsolete addition STRUCTURE, the system checks in non-
Unicode programs whether the assigned data object is
aligned correctly (at pass-by-reference), has the same length and - in the case of function modules - whether it is also a
flat structure. When using formal
parameters of subroutines and table parameters of function modules, the length of the actual parameter
must be at least the length of the cast structure. In Unicode programs, elementary data objects must be character type and flat. In the case of structures, the
Unicode fragment views must match.
Note
In the case of external procedure calls between Unicode and non-Unicode programs and vice versa, the typing check is always done from the view of the caller.