mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
docs: Explain that public library functions cannot be called internally from the outside
This commit is contained in:
parent
e1464fa4fb
commit
8c6bbf607f
@ -38,6 +38,12 @@ To realize this in the EVM, code of internal library functions
|
||||
and all functions called from therein will at compile time be included in the calling
|
||||
contract, and a regular ``JUMP`` call will be used instead of a ``DELEGATECALL``.
|
||||
|
||||
.. note::
|
||||
The inheritance analogy breaks down when it comes to public functions.
|
||||
Calling a public library function with ``L.f()`` results in an external call (``DELEGATECALL``
|
||||
to be precise).
|
||||
In contrast, ``A.f()`` is an internal call when ``A`` is a base contract of the current contract.
|
||||
|
||||
.. index:: using for, set
|
||||
|
||||
The following example illustrates how to use libraries (but using a manual method,
|
||||
|
Loading…
Reference in New Issue
Block a user