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:
Leo 2022-08-15 15:53:49 +02:00 committed by GitHub
commit c0e678033c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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