# loki.types.procedure_type module

Representation of a procedure type for function or subroutine type definitions.

class ProcedureType(name=None, is_function=None, is_generic=False, is_intrinsic=False, procedure=None, return_type=None)

  Bases: `DataType`

  Representation of a function or subroutine type definition.

  This serves also as the cross-link between the use of a procedure (e.g. in a `CallStatement`) to the `Subroutine` object that is the target of a call.

  Parameters:

    - name (str, optional) – The name of the function or subroutine. Can be skipped if `procedure` is provided.

    - is_function (bool, optional) – Indicate that this is a function

    - is_generic (bool, optional) – Indicate that this is a generic function

    - is_intrinsic (bool, optional) – Indicate that this is an intrinsic function

    - procedure (`Subroutine` or `StatementFunction`, optional) – The procedure this type represents

  property name

    The name of the procedure

    This looks up the name in the linked `procedure` if available, otherwise returns the name stored during instanation of the `ProcedureType` object.

  property procedure

    The `Subroutine` object of the procedure

    If not provided during instantiation or if the underlying `weakref` is dead, this returns `BasicType.DEFERRED`.

  property is_function

    Return True if the procedure is a function, otherwise False

  property is_elemental

    Return `True` if the procedure has the `elemental` prefix, otherwise `False`

  property return_type

    The return type of the function (or None)