Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Unambiguous Generic Procedure References

When a generic procedure reference is made, a specific procedure is invoked. If the following rules are used, the generic reference will be unambiguous:

  • Two dummy arguments are said to be distinguishable if any of the following are true:

    • One is a procedure and the other is a data object.

    • One has the ALLOCATABLE attribute and the other has the POINTER attribute without INTENT (IN).

    • They are both data objects or both known to be functions, and they have different type and kind parameters, or different rank.

    • One is a function with nonzero rank and the other is not known to be a function.

  • Within a scoping unit, two procedures that have the same generic name must both be subroutines or both be functions. One of the procedures must have a nonoptional dummy argument that is one of the following:

    • Not present by position or argument keyword in the other argument list

    • Is present, but is distinguishable from the dummy argument in the other argument list

  • Within a scoping unit, two procedures that have the same generic operator must both have the same number of arguments or both define assignment.

    One of the procedures must have a dummy argument that corresponds, by position in the argument list, to a dummy argument of the other procedure. The dummy arguments must be distinguishable from each other in each argument list.

When an interface block extends an intrinsic procedure, operator, or assignment, the rules apply as if the intrinsic consists of a collection of specific procedures, one for each allowed set of arguments.

When a generic procedure is accessed from a module, the rules apply to all the specific versions, even if some of them are inaccessible by their specific names.

See Also