docs: Clarify which functions can be assigned to function variables

This commit is contained in:
Kamil Śliwak 2021-03-25 19:19:06 +01:00
parent 36f769662b
commit 67dea6c4f1

View File

@ -663,6 +663,16 @@ Note that public functions of the current contract can be used both as an
internal and as an external function. To use ``f`` as an internal function, internal and as an external function. To use ``f`` as an internal function,
just use ``f``, if you want to use its external form, use ``this.f``. just use ``f``, if you want to use its external form, use ``this.f``.
A function of an internal type can be assigned to a variable of an internal function type regardless
of where it is defined.
This includes private, internal and public functions of both contracts and libraries as well as free
functions.
External function types, on the other hand, are only compatible with public and external contract
functions.
Libraries are excluded because they require a ``delegatecall`` and use :ref:`a different ABI
convention for their selectors <library-selectors>`.
Functions declared in interfaces do not have definitions so pointing at them does not make sense either.
Members: Members:
External (or public) functions have the following members: External (or public) functions have the following members: