mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12855 from aathan/patch-12
Rephrase named vs unnamed parameters in function definitions (in control-structures.rst).
This commit is contained in:
commit
c0e678033c
@ -150,8 +150,8 @@ throws an exception or goes out of gas.
|
||||
use ``f.value(x).gas(g)()``. This was deprecated in Solidity 0.6.2 and is no
|
||||
longer possible since Solidity 0.7.0.
|
||||
|
||||
Named Calls and Anonymous Function Parameters
|
||||
---------------------------------------------
|
||||
Function Calls with Named Parameters
|
||||
------------------------------------
|
||||
|
||||
Function call arguments can be given by name, in any order,
|
||||
if they are enclosed in ``{ }`` as can be seen in the following
|
||||
@ -176,11 +176,13 @@ parameters from the function declaration, but can be in arbitrary order.
|
||||
|
||||
}
|
||||
|
||||
Omitted Function Parameter Names
|
||||
--------------------------------
|
||||
Omitted Names in Function Definitions
|
||||
-------------------------------------
|
||||
|
||||
The names of unused parameters (especially return parameters) can be omitted.
|
||||
Those parameters will still be present on the stack, but they are inaccessible.
|
||||
The names of parameters and return values in the function declaration can be omitted.
|
||||
Those items with omitted names will still be present on the stack, but they are
|
||||
inaccessible by name. An omitted return value name
|
||||
can still return a value to the caller by use of the ``return`` statement.
|
||||
|
||||
.. code-block:: solidity
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user